We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Terminology is not updated when term units are updated
the terminology stemmer listens to `submission.post_save` - but submissions are always `bulk_created` so it doesn't seem to get triggered

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `pootle/apps/pootle_terminology/receivers.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 #
3 # Copyright (C) Pootle contributors.
4 #
5 # This file is a part of the Pootle project. It is distributed under the GPL3
6 # or later license. See the LICENSE file for a copy of the license and the
7 # AUTHORS file for copyright and authorship information.
8 
9 from django.db.models.signals import post_save
10 from django.dispatch import receiver
11 
12 from pootle.core.delegate import terminology
13 from pootle_statistics.models import Submission, SubmissionFields
14 from pootle_store.constants import TRANSLATED
15 from pootle_store.models import Unit
16 
17 
18 @receiver(post_save, sender=Unit)
19 def handle_unit_save(**kwargs):
20     unit = kwargs["instance"]
21     if not kwargs.get("created"):
22         return
23     if unit.state != TRANSLATED:
24         return
25     is_terminology = (
26         unit.store.name.startswith("pootle-terminology")
27         or (unit.store.translation_project.project.code
28             == "terminology"))
29     if not is_terminology:
30         return
31     terminology.get(Unit)(unit).stem()
32 
33 
34 @receiver(post_save, sender=Submission)
35 def handle_submission_save(**kwargs):
36     sub = kwargs["instance"]
37     if sub.type != SubmissionFields.TARGET:
38         return
39     unit = sub.unit
40     if unit.state != TRANSLATED:
41         return
42     is_terminology = (
43         unit.store.name.startswith("pootle-terminology")
44         or (unit.store.translation_project.project.code
45             == "terminology"))
46     if not is_terminology:
47         return
48     terminology.get(Unit)(unit).stem()
49
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/pootle/apps/pootle_terminology/receivers.py b/pootle/apps/pootle_terminology/receivers.py
--- a/pootle/apps/pootle_terminology/receivers.py
+++ b/pootle/apps/pootle_terminology/receivers.py
@@ -34,7 +34,7 @@
 @receiver(post_save, sender=Submission)
 def handle_submission_save(**kwargs):
     sub = kwargs["instance"]
-    if sub.type != SubmissionFields.TARGET:
+    if sub.field != SubmissionFields.TARGET:
         return
     unit = sub.unit
     if unit.state != TRANSLATED:

{"golden_diff": "diff --git a/pootle/apps/pootle_terminology/receivers.py b/pootle/apps/pootle_terminology/receivers.py\n--- a/pootle/apps/pootle_terminology/receivers.py\n+++ b/pootle/apps/pootle_terminology/receivers.py\n@@ -34,7 +34,7 @@\n @receiver(post_save, sender=Submission)\n def handle_submission_save(**kwargs):\n     sub = kwargs[\"instance\"]\n-    if sub.type != SubmissionFields.TARGET:\n+    if sub.field != SubmissionFields.TARGET:\n         return\n     unit = sub.unit\n     if unit.state != TRANSLATED:\n", "issue": "Terminology is not updated when term units are updated\nthe terminology stemmer listens to `submission.post_save` - but submissions are always `bulk_created` so it doesn't seem to get triggered\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n#\n# Copyright (C) Pootle contributors.\n#\n# This file is a part of the Pootle project. It is distributed under the GPL3\n# or later license. See the LICENSE file for a copy of the license and the\n# AUTHORS file for copyright and authorship information.\n\nfrom django.db.models.signals import post_save\nfrom django.dispatch import receiver\n\nfrom pootle.core.delegate import terminology\nfrom pootle_statistics.models import Submission, SubmissionFields\nfrom pootle_store.constants import TRANSLATED\nfrom pootle_store.models import Unit\n\n\n@receiver(post_save, sender=Unit)\ndef handle_unit_save(**kwargs):\n    unit = kwargs[\"instance\"]\n    if not kwargs.get(\"created\"):\n        return\n    if unit.state != TRANSLATED:\n        return\n    is_terminology = (\n        unit.store.name.startswith(\"pootle-terminology\")\n        or (unit.store.translation_project.project.code\n            == \"terminology\"))\n    if not is_terminology:\n        return\n    terminology.get(Unit)(unit).stem()\n\n\n@receiver(post_save, sender=Submission)\ndef handle_submission_save(**kwargs):\n    sub = kwargs[\"instance\"]\n    if sub.type != SubmissionFields.TARGET:\n        return\n    unit = sub.unit\n    if unit.state != TRANSLATED:\n        return\n    is_terminology = (\n        unit.store.name.startswith(\"pootle-terminology\")\n        or (unit.store.translation_project.project.code\n            == \"terminology\"))\n    if not is_terminology:\n        return\n    terminology.get(Unit)(unit).stem()\n", "path": "pootle/apps/pootle_terminology/receivers.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n#\n# Copyright (C) Pootle contributors.\n#\n# This file is a part of the Pootle project. It is distributed under the GPL3\n# or later license. See the LICENSE file for a copy of the license and the\n# AUTHORS file for copyright and authorship information.\n\nfrom django.db.models.signals import post_save\nfrom django.dispatch import receiver\n\nfrom pootle.core.delegate import terminology\nfrom pootle_statistics.models import Submission, SubmissionFields\nfrom pootle_store.constants import TRANSLATED\nfrom pootle_store.models import Unit\n\n\n@receiver(post_save, sender=Unit)\ndef handle_unit_save(**kwargs):\n    unit = kwargs[\"instance\"]\n    if not kwargs.get(\"created\"):\n        return\n    if unit.state != TRANSLATED:\n        return\n    is_terminology = (\n        unit.store.name.startswith(\"pootle-terminology\")\n        or (unit.store.translation_project.project.code\n            == \"terminology\"))\n    if not is_terminology:\n        return\n    terminology.get(Unit)(unit).stem()\n\n\n@receiver(post_save, sender=Submission)\ndef handle_submission_save(**kwargs):\n    sub = kwargs[\"instance\"]\n    if sub.field != SubmissionFields.TARGET:\n        return\n    unit = sub.unit\n    if unit.state != TRANSLATED:\n        return\n    is_terminology = (\n        unit.store.name.startswith(\"pootle-terminology\")\n        or (unit.store.translation_project.project.code\n            == \"terminology\"))\n    if not is_terminology:\n        return\n    terminology.get(Unit)(unit).stem()\n", "path": "pootle/apps/pootle_terminology/receivers.py"}]}