We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
when bplan is archived, office worker update email is sent
**URL:** 
**user:** 
**expected behaviour:** Office workers only get an update email when bplan is "published, changed or created as draft"
**behaviour:** The automatic archiving also changes the bplan and by that triggers the email. Thinking about it, it should also trigger the get-point thing (and might result in failure errors being thrown).
**important screensize:**
**device & browser:** 
**Comment/Question:** 

Screenshot?


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `meinberlin/apps/bplan/signals.py`
Content:
```
1 from django.db.models.signals import post_save
2 from django.dispatch import receiver
3 
4 from . import emails
5 from . import tasks
6 from .models import Bplan
7 from .models import Statement
8 
9 
10 @receiver(post_save, sender=Bplan)
11 def get_location(sender, instance, update_fields, **kwargs):
12     if instance.identifier and (not update_fields or
13                                 'point' not in update_fields):
14         tasks.get_location_information(instance.pk)
15 
16 
17 @receiver(post_save, sender=Statement)
18 def send_notification(sender, instance, created, **kwargs):
19     if created:
20         emails.OfficeWorkerNotification.send(instance)
21 
22         if instance.email:
23             emails.SubmitterConfirmation.send(instance)
24 
25 
26 @receiver(post_save, sender=Bplan)
27 def send_update(sender, instance, update_fields, **kwargs):
28     if not update_fields or 'point' not in update_fields:
29         emails.OfficeWorkerUpdateConfirmation.send(instance)
30
```

Path: `meinberlin/apps/bplan/management/commands/bplan_auto_archive.py`
Content:
```
1 from datetime import timedelta
2 
3 from django.core.management.base import BaseCommand
4 from django.utils import timezone
5 
6 from meinberlin.apps.bplan import models as bplan_models
7 
8 
9 class Command(BaseCommand):
10     help = 'Archive finished bplan projects and delete old statements.'
11 
12     def handle(self, *args, **options):
13         bplans = bplan_models.Bplan.objects.filter(is_draft=False)
14         for bplan in bplans:
15             if bplan.has_finished and not bplan.is_archived:
16                 bplan.is_archived = True
17                 bplan.save()
18                 self.stdout.write('Archived bplan {}.'.format(bplan.name))
19 
20         # Delete statements of archived projects
21         # To prevent deleting statements that have not been sent by mail yet
22         # only statements older then 48h are deleted.
23         num_deleted, _ = bplan_models.Statement.objects\
24             .filter(module__project__is_archived=True)\
25             .filter(created__lt=timezone.now() - timedelta(hours=48))\
26             .delete()
27         if num_deleted:
28             self.stdout.write('Deleted {} statements from archived bplans.'
29                               .format(num_deleted))
30
```
--- 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/meinberlin/apps/bplan/management/commands/bplan_auto_archive.py b/meinberlin/apps/bplan/management/commands/bplan_auto_archive.py
--- a/meinberlin/apps/bplan/management/commands/bplan_auto_archive.py
+++ b/meinberlin/apps/bplan/management/commands/bplan_auto_archive.py
@@ -14,7 +14,9 @@
         for bplan in bplans:
             if bplan.has_finished and not bplan.is_archived:
                 bplan.is_archived = True
-                bplan.save()
+                bplan.save(
+                    update_fields=['is_archived']
+                )
                 self.stdout.write('Archived bplan {}.'.format(bplan.name))
 
         # Delete statements of archived projects
diff --git a/meinberlin/apps/bplan/signals.py b/meinberlin/apps/bplan/signals.py
--- a/meinberlin/apps/bplan/signals.py
+++ b/meinberlin/apps/bplan/signals.py
@@ -10,7 +10,8 @@
 @receiver(post_save, sender=Bplan)
 def get_location(sender, instance, update_fields, **kwargs):
     if instance.identifier and (not update_fields or
-                                'point' not in update_fields):
+                                ('point' not in update_fields and
+                                 'is_archived' not in update_fields)):
         tasks.get_location_information(instance.pk)
 
 
@@ -25,5 +26,6 @@
 
 @receiver(post_save, sender=Bplan)
 def send_update(sender, instance, update_fields, **kwargs):
-    if not update_fields or 'point' not in update_fields:
+    if (not update_fields or ('point' not in update_fields and
+                              'is_archived' not in update_fields)):
         emails.OfficeWorkerUpdateConfirmation.send(instance)

{"golden_diff": "diff --git a/meinberlin/apps/bplan/management/commands/bplan_auto_archive.py b/meinberlin/apps/bplan/management/commands/bplan_auto_archive.py\n--- a/meinberlin/apps/bplan/management/commands/bplan_auto_archive.py\n+++ b/meinberlin/apps/bplan/management/commands/bplan_auto_archive.py\n@@ -14,7 +14,9 @@\n         for bplan in bplans:\n             if bplan.has_finished and not bplan.is_archived:\n                 bplan.is_archived = True\n-                bplan.save()\n+                bplan.save(\n+                    update_fields=['is_archived']\n+                )\n                 self.stdout.write('Archived bplan {}.'.format(bplan.name))\n \n         # Delete statements of archived projects\ndiff --git a/meinberlin/apps/bplan/signals.py b/meinberlin/apps/bplan/signals.py\n--- a/meinberlin/apps/bplan/signals.py\n+++ b/meinberlin/apps/bplan/signals.py\n@@ -10,7 +10,8 @@\n @receiver(post_save, sender=Bplan)\n def get_location(sender, instance, update_fields, **kwargs):\n     if instance.identifier and (not update_fields or\n-                                'point' not in update_fields):\n+                                ('point' not in update_fields and\n+                                 'is_archived' not in update_fields)):\n         tasks.get_location_information(instance.pk)\n \n \n@@ -25,5 +26,6 @@\n \n @receiver(post_save, sender=Bplan)\n def send_update(sender, instance, update_fields, **kwargs):\n-    if not update_fields or 'point' not in update_fields:\n+    if (not update_fields or ('point' not in update_fields and\n+                              'is_archived' not in update_fields)):\n         emails.OfficeWorkerUpdateConfirmation.send(instance)\n", "issue": "when bplan is archived, office worker update email is sent\n**URL:** \r\n**user:** \r\n**expected behaviour:** Office workers only get an update email when bplan is \"published, changed or created as draft\"\r\n**behaviour:** The automatic archiving also changes the bplan and by that triggers the email. Thinking about it, it should also trigger the get-point thing (and might result in failure errors being thrown).\r\n**important screensize:**\r\n**device & browser:** \r\n**Comment/Question:** \r\n\r\nScreenshot?\r\n\n", "before_files": [{"content": "from django.db.models.signals import post_save\nfrom django.dispatch import receiver\n\nfrom . import emails\nfrom . import tasks\nfrom .models import Bplan\nfrom .models import Statement\n\n\n@receiver(post_save, sender=Bplan)\ndef get_location(sender, instance, update_fields, **kwargs):\n    if instance.identifier and (not update_fields or\n                                'point' not in update_fields):\n        tasks.get_location_information(instance.pk)\n\n\n@receiver(post_save, sender=Statement)\ndef send_notification(sender, instance, created, **kwargs):\n    if created:\n        emails.OfficeWorkerNotification.send(instance)\n\n        if instance.email:\n            emails.SubmitterConfirmation.send(instance)\n\n\n@receiver(post_save, sender=Bplan)\ndef send_update(sender, instance, update_fields, **kwargs):\n    if not update_fields or 'point' not in update_fields:\n        emails.OfficeWorkerUpdateConfirmation.send(instance)\n", "path": "meinberlin/apps/bplan/signals.py"}, {"content": "from datetime import timedelta\n\nfrom django.core.management.base import BaseCommand\nfrom django.utils import timezone\n\nfrom meinberlin.apps.bplan import models as bplan_models\n\n\nclass Command(BaseCommand):\n    help = 'Archive finished bplan projects and delete old statements.'\n\n    def handle(self, *args, **options):\n        bplans = bplan_models.Bplan.objects.filter(is_draft=False)\n        for bplan in bplans:\n            if bplan.has_finished and not bplan.is_archived:\n                bplan.is_archived = True\n                bplan.save()\n                self.stdout.write('Archived bplan {}.'.format(bplan.name))\n\n        # Delete statements of archived projects\n        # To prevent deleting statements that have not been sent by mail yet\n        # only statements older then 48h are deleted.\n        num_deleted, _ = bplan_models.Statement.objects\\\n            .filter(module__project__is_archived=True)\\\n            .filter(created__lt=timezone.now() - timedelta(hours=48))\\\n            .delete()\n        if num_deleted:\n            self.stdout.write('Deleted {} statements from archived bplans.'\n                              .format(num_deleted))\n", "path": "meinberlin/apps/bplan/management/commands/bplan_auto_archive.py"}], "after_files": [{"content": "from django.db.models.signals import post_save\nfrom django.dispatch import receiver\n\nfrom . import emails\nfrom . import tasks\nfrom .models import Bplan\nfrom .models import Statement\n\n\n@receiver(post_save, sender=Bplan)\ndef get_location(sender, instance, update_fields, **kwargs):\n    if instance.identifier and (not update_fields or\n                                ('point' not in update_fields and\n                                 'is_archived' not in update_fields)):\n        tasks.get_location_information(instance.pk)\n\n\n@receiver(post_save, sender=Statement)\ndef send_notification(sender, instance, created, **kwargs):\n    if created:\n        emails.OfficeWorkerNotification.send(instance)\n\n        if instance.email:\n            emails.SubmitterConfirmation.send(instance)\n\n\n@receiver(post_save, sender=Bplan)\ndef send_update(sender, instance, update_fields, **kwargs):\n    if (not update_fields or ('point' not in update_fields and\n                              'is_archived' not in update_fields)):\n        emails.OfficeWorkerUpdateConfirmation.send(instance)\n", "path": "meinberlin/apps/bplan/signals.py"}, {"content": "from datetime import timedelta\n\nfrom django.core.management.base import BaseCommand\nfrom django.utils import timezone\n\nfrom meinberlin.apps.bplan import models as bplan_models\n\n\nclass Command(BaseCommand):\n    help = 'Archive finished bplan projects and delete old statements.'\n\n    def handle(self, *args, **options):\n        bplans = bplan_models.Bplan.objects.filter(is_draft=False)\n        for bplan in bplans:\n            if bplan.has_finished and not bplan.is_archived:\n                bplan.is_archived = True\n                bplan.save(\n                    update_fields=['is_archived']\n                )\n                self.stdout.write('Archived bplan {}.'.format(bplan.name))\n\n        # Delete statements of archived projects\n        # To prevent deleting statements that have not been sent by mail yet\n        # only statements older then 48h are deleted.\n        num_deleted, _ = bplan_models.Statement.objects\\\n            .filter(module__project__is_archived=True)\\\n            .filter(created__lt=timezone.now() - timedelta(hours=48))\\\n            .delete()\n        if num_deleted:\n            self.stdout.write('Deleted {} statements from archived bplans.'\n                              .format(num_deleted))\n", "path": "meinberlin/apps/bplan/management/commands/bplan_auto_archive.py"}]}