We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Make contact form send to mail list for HS, instead of individual members
The form currently fetches all members of the HS group, and sends the message to each individual address. This makes it cumbersome to discuss the message for HS, it would be better to send it to their mailing list instead.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `lego/apps/users/fixtures/initial_abakus_groups.py`
Content:
```
1 from lego.apps.users.constants import GROUP_COMMITTEE, GROUP_GRADE
2 from lego.apps.users.models import AbakusGroup
3 from lego.utils.functions import insert_abakus_groups
4 
5 #  isort:skip
6 """
7 The structure of the tree is key and a list of two dicts.
8 The first dict is the parameters of the current group
9 and the second dict are the children of the current group.
10 
11 E.g. Abakus: [
12     {
13         description: 'ABAKUSGRUPPE',
14         permissions: ['/sudo/...']
15         ...
16     },
17     {
18         'Webkom': [{
19             description: 'WEBKOMGRUPPE',
20             permissions: ['/sudo/']
21             ...
22         }, {}]
23     }
24 ]
25 """
26 
27 initial_tree = {
28     'Users': [{
29         'description': 'Brukere på Abakus.no'
30     }, {}],
31     'Abakus': [
32         {
33             'description':
34             'Medlemmer av Abakus',
35             'permissions': [
36                 '/sudo/admin/meetings/create', '/sudo/admin/meetinginvitations/create',
37                 '/sudo/admin/registrations/create/', '/sudo/admin/events/payment/',
38                 '/sudo/admin/comments/create'
39             ]
40         },
41         {
42             'Abakom': [
43                 {
44                     'description':
45                     'Medlemmer av Abakom',
46                     'permissions': [
47                         '/sudo/admin/events/',
48                         '/sudo/admin/pools/',
49                         '/sudo/admin/registrations/',
50                         '/sudo/admin/companies/',
51                         '/sudo/admin/joblistings/',
52                     ]
53                 },
54                 {
55                     'Arrkom': [{
56                         'type': GROUP_COMMITTEE,
57                         'logo_id': 'abakus_arrkom.png'
58                     }, {}],
59                     'backup': [{
60                         'type': GROUP_COMMITTEE,
61                         'logo_id': 'abakus_backup.png'
62                     }, {}],
63                     'Bedkom': [
64                         {
65                             'type':
66                             GROUP_COMMITTEE,
67                             'logo_id':
68                             'abakus_bedkom.png',
69                             'permissions': [
70                                 '/sudo/admin/companyinterest/', '/sudo/admin/surveys/',
71                                 '/sudo/admin/submissions/'
72                             ]
73                         }, {}
74                     ],
75                     'Fagkom': [
76                         {
77                             'type':
78                             GROUP_COMMITTEE,
79                             'logo_id':
80                             'abakus_fagkom.png',
81                             'permissions': [
82                                 '/sudo/admin/companyinterest/', '/sudo/admin/surveys/',
83                                 '/sudo/admin/submissions/'
84                             ]
85                         }, {}
86                     ],
87                     'Koskom': [{
88                         'type': GROUP_COMMITTEE,
89                         'logo_id': 'abakus_koskom.png'
90                     }, {}],
91                     'LaBamba': [{
92                         'type': GROUP_COMMITTEE,
93                         'logo_id': 'abakus_labamba.png'
94                     }, {}],
95                     'PR': [{
96                         'type': GROUP_COMMITTEE,
97                         'logo_id': 'abakus_pr.png'
98                     }, {}],
99                     'readme': [{
100                         'type': GROUP_COMMITTEE,
101                         'logo_id': 'abakus_readme.png'
102                     }, {}],
103                     'Webkom': [
104                         {
105                             'type': GROUP_COMMITTEE,
106                             'logo_id': 'abakus_webkom.png',
107                             'permissions': ['/sudo/'],
108                             'text': 'hei'
109                         }, {}
110                     ],
111                     'Hovedstyret':
112                     [{
113                         'logo_id': 'abakus_hs.png',
114                         'permissions': ['/sudo/admin/'],
115                     }, {}]
116                 }
117             ],
118             'Interessegrupper':
119             [{
120                 'description': 'Super-gruppe for alle interessegrupper i Abakus'
121             }, {}]
122         }
123     ],
124     'Students': [
125         {},
126         {
127             'Datateknologi': [
128                 {},
129                 {
130                     '1. klasse Datateknologi': [{
131                         'type': GROUP_GRADE
132                     }, {}],
133                     '2. klasse Datateknologi': [{
134                         'type': GROUP_GRADE
135                     }, {}],
136                     '3. klasse Datateknologi': [{
137                         'type': GROUP_GRADE
138                     }, {}],
139                     '4. klasse Datateknologi': [{
140                         'type': GROUP_GRADE
141                     }, {}],
142                     '5. klasse Datateknologi': [{
143                         'type': GROUP_GRADE
144                     }, {}],
145                 }
146             ],
147             'Kommunikasjonsteknologi': [
148                 {},
149                 {
150                     '1. klasse Kommunikasjonsteknologi': [{
151                         'type': GROUP_GRADE
152                     }, {}],
153                     '2. klasse Kommunikasjonsteknologi': [{
154                         'type': GROUP_GRADE
155                     }, {}],
156                     '3. klasse Kommunikasjonsteknologi': [{
157                         'type': GROUP_GRADE
158                     }, {}],
159                     '4. klasse Kommunikasjonsteknologi': [{
160                         'type': GROUP_GRADE
161                     }, {}],
162                     '5. klasse Kommunikasjonsteknologi': [{
163                         'type': GROUP_GRADE
164                     }, {}],
165                 }
166             ]
167         }
168     ]
169 }
170 
171 
172 def load_abakus_groups():
173     insert_abakus_groups(initial_tree)
174     AbakusGroup.objects.rebuild()
175
```

Path: `lego/apps/contact/send.py`
Content:
```
1 from lego.apps.users.models import AbakusGroup
2 from lego.utils.tasks import send_email
3 
4 
5 def send_message(title, message, user, anonymous):
6     """
7     Send a message to HS when users posts to the contact form.
8     Don't catch AbakusGroup.DoesNotExist, this notifies us when the group doesn't exist.
9     """
10     anonymous = anonymous if user.is_authenticated else True
11     abakus_group = AbakusGroup.objects.get(name='Hovedstyret')
12     users = [membership.user for membership in abakus_group.memberships.select_related('user')]
13     emails = [user.email_address for user in users]
14 
15     from_name = 'Anonymous' if anonymous else user.full_name
16     from_email = 'Unknown' if anonymous else user.email_address
17 
18     send_email.delay(
19         to_email=emails, context={
20             'title': title,
21             'message': message,
22             'from_name': from_name,
23             'from_email': from_email
24         }, subject='Ny henvendelse fra kontaktskjemaet',
25         plain_template='contact/email/contact_form.txt',
26         html_template='contact/email/contact_form.html', from_email=None
27     )
28
```
--- 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/lego/apps/contact/send.py b/lego/apps/contact/send.py
--- a/lego/apps/contact/send.py
+++ b/lego/apps/contact/send.py
@@ -9,14 +9,12 @@
     """
     anonymous = anonymous if user.is_authenticated else True
     abakus_group = AbakusGroup.objects.get(name='Hovedstyret')
-    users = [membership.user for membership in abakus_group.memberships.select_related('user')]
-    emails = [user.email_address for user in users]
 
     from_name = 'Anonymous' if anonymous else user.full_name
     from_email = 'Unknown' if anonymous else user.email_address
 
     send_email.delay(
-        to_email=emails, context={
+        to_email=abakus_group.contact_email, context={
             'title': title,
             'message': message,
             'from_name': from_name,
diff --git a/lego/apps/users/fixtures/initial_abakus_groups.py b/lego/apps/users/fixtures/initial_abakus_groups.py
--- a/lego/apps/users/fixtures/initial_abakus_groups.py
+++ b/lego/apps/users/fixtures/initial_abakus_groups.py
@@ -108,11 +108,13 @@
                             'text': 'hei'
                         }, {}
                     ],
-                    'Hovedstyret':
-                    [{
-                        'logo_id': 'abakus_hs.png',
-                        'permissions': ['/sudo/admin/'],
-                    }, {}]
+                    'Hovedstyret': [
+                        {
+                            'logo_id': 'abakus_hs.png',
+                            'permissions': ['/sudo/admin/'],
+                            'contact_email': "hs@abakus.no"
+                        }, {}
+                    ]
                 }
             ],
             'Interessegrupper':

{"golden_diff": "diff --git a/lego/apps/contact/send.py b/lego/apps/contact/send.py\n--- a/lego/apps/contact/send.py\n+++ b/lego/apps/contact/send.py\n@@ -9,14 +9,12 @@\n     \"\"\"\n     anonymous = anonymous if user.is_authenticated else True\n     abakus_group = AbakusGroup.objects.get(name='Hovedstyret')\n-    users = [membership.user for membership in abakus_group.memberships.select_related('user')]\n-    emails = [user.email_address for user in users]\n \n     from_name = 'Anonymous' if anonymous else user.full_name\n     from_email = 'Unknown' if anonymous else user.email_address\n \n     send_email.delay(\n-        to_email=emails, context={\n+        to_email=abakus_group.contact_email, context={\n             'title': title,\n             'message': message,\n             'from_name': from_name,\ndiff --git a/lego/apps/users/fixtures/initial_abakus_groups.py b/lego/apps/users/fixtures/initial_abakus_groups.py\n--- a/lego/apps/users/fixtures/initial_abakus_groups.py\n+++ b/lego/apps/users/fixtures/initial_abakus_groups.py\n@@ -108,11 +108,13 @@\n                             'text': 'hei'\n                         }, {}\n                     ],\n-                    'Hovedstyret':\n-                    [{\n-                        'logo_id': 'abakus_hs.png',\n-                        'permissions': ['/sudo/admin/'],\n-                    }, {}]\n+                    'Hovedstyret': [\n+                        {\n+                            'logo_id': 'abakus_hs.png',\n+                            'permissions': ['/sudo/admin/'],\n+                            'contact_email': \"hs@abakus.no\"\n+                        }, {}\n+                    ]\n                 }\n             ],\n             'Interessegrupper':\n", "issue": "Make contact form send to mail list for HS, instead of individual members\nThe form currently fetches all members of the HS group, and sends the message to each individual address. This makes it cumbersome to discuss the message for HS, it would be better to send it to their mailing list instead.\n", "before_files": [{"content": "from lego.apps.users.constants import GROUP_COMMITTEE, GROUP_GRADE\nfrom lego.apps.users.models import AbakusGroup\nfrom lego.utils.functions import insert_abakus_groups\n\n#  isort:skip\n\"\"\"\nThe structure of the tree is key and a list of two dicts.\nThe first dict is the parameters of the current group\nand the second dict are the children of the current group.\n\nE.g. Abakus: [\n    {\n        description: 'ABAKUSGRUPPE',\n        permissions: ['/sudo/...']\n        ...\n    },\n    {\n        'Webkom': [{\n            description: 'WEBKOMGRUPPE',\n            permissions: ['/sudo/']\n            ...\n        }, {}]\n    }\n]\n\"\"\"\n\ninitial_tree = {\n    'Users': [{\n        'description': 'Brukere p\u00e5 Abakus.no'\n    }, {}],\n    'Abakus': [\n        {\n            'description':\n            'Medlemmer av Abakus',\n            'permissions': [\n                '/sudo/admin/meetings/create', '/sudo/admin/meetinginvitations/create',\n                '/sudo/admin/registrations/create/', '/sudo/admin/events/payment/',\n                '/sudo/admin/comments/create'\n            ]\n        },\n        {\n            'Abakom': [\n                {\n                    'description':\n                    'Medlemmer av Abakom',\n                    'permissions': [\n                        '/sudo/admin/events/',\n                        '/sudo/admin/pools/',\n                        '/sudo/admin/registrations/',\n                        '/sudo/admin/companies/',\n                        '/sudo/admin/joblistings/',\n                    ]\n                },\n                {\n                    'Arrkom': [{\n                        'type': GROUP_COMMITTEE,\n                        'logo_id': 'abakus_arrkom.png'\n                    }, {}],\n                    'backup': [{\n                        'type': GROUP_COMMITTEE,\n                        'logo_id': 'abakus_backup.png'\n                    }, {}],\n                    'Bedkom': [\n                        {\n                            'type':\n                            GROUP_COMMITTEE,\n                            'logo_id':\n                            'abakus_bedkom.png',\n                            'permissions': [\n                                '/sudo/admin/companyinterest/', '/sudo/admin/surveys/',\n                                '/sudo/admin/submissions/'\n                            ]\n                        }, {}\n                    ],\n                    'Fagkom': [\n                        {\n                            'type':\n                            GROUP_COMMITTEE,\n                            'logo_id':\n                            'abakus_fagkom.png',\n                            'permissions': [\n                                '/sudo/admin/companyinterest/', '/sudo/admin/surveys/',\n                                '/sudo/admin/submissions/'\n                            ]\n                        }, {}\n                    ],\n                    'Koskom': [{\n                        'type': GROUP_COMMITTEE,\n                        'logo_id': 'abakus_koskom.png'\n                    }, {}],\n                    'LaBamba': [{\n                        'type': GROUP_COMMITTEE,\n                        'logo_id': 'abakus_labamba.png'\n                    }, {}],\n                    'PR': [{\n                        'type': GROUP_COMMITTEE,\n                        'logo_id': 'abakus_pr.png'\n                    }, {}],\n                    'readme': [{\n                        'type': GROUP_COMMITTEE,\n                        'logo_id': 'abakus_readme.png'\n                    }, {}],\n                    'Webkom': [\n                        {\n                            'type': GROUP_COMMITTEE,\n                            'logo_id': 'abakus_webkom.png',\n                            'permissions': ['/sudo/'],\n                            'text': 'hei'\n                        }, {}\n                    ],\n                    'Hovedstyret':\n                    [{\n                        'logo_id': 'abakus_hs.png',\n                        'permissions': ['/sudo/admin/'],\n                    }, {}]\n                }\n            ],\n            'Interessegrupper':\n            [{\n                'description': 'Super-gruppe for alle interessegrupper i Abakus'\n            }, {}]\n        }\n    ],\n    'Students': [\n        {},\n        {\n            'Datateknologi': [\n                {},\n                {\n                    '1. klasse Datateknologi': [{\n                        'type': GROUP_GRADE\n                    }, {}],\n                    '2. klasse Datateknologi': [{\n                        'type': GROUP_GRADE\n                    }, {}],\n                    '3. klasse Datateknologi': [{\n                        'type': GROUP_GRADE\n                    }, {}],\n                    '4. klasse Datateknologi': [{\n                        'type': GROUP_GRADE\n                    }, {}],\n                    '5. klasse Datateknologi': [{\n                        'type': GROUP_GRADE\n                    }, {}],\n                }\n            ],\n            'Kommunikasjonsteknologi': [\n                {},\n                {\n                    '1. klasse Kommunikasjonsteknologi': [{\n                        'type': GROUP_GRADE\n                    }, {}],\n                    '2. klasse Kommunikasjonsteknologi': [{\n                        'type': GROUP_GRADE\n                    }, {}],\n                    '3. klasse Kommunikasjonsteknologi': [{\n                        'type': GROUP_GRADE\n                    }, {}],\n                    '4. klasse Kommunikasjonsteknologi': [{\n                        'type': GROUP_GRADE\n                    }, {}],\n                    '5. klasse Kommunikasjonsteknologi': [{\n                        'type': GROUP_GRADE\n                    }, {}],\n                }\n            ]\n        }\n    ]\n}\n\n\ndef load_abakus_groups():\n    insert_abakus_groups(initial_tree)\n    AbakusGroup.objects.rebuild()\n", "path": "lego/apps/users/fixtures/initial_abakus_groups.py"}, {"content": "from lego.apps.users.models import AbakusGroup\nfrom lego.utils.tasks import send_email\n\n\ndef send_message(title, message, user, anonymous):\n    \"\"\"\n    Send a message to HS when users posts to the contact form.\n    Don't catch AbakusGroup.DoesNotExist, this notifies us when the group doesn't exist.\n    \"\"\"\n    anonymous = anonymous if user.is_authenticated else True\n    abakus_group = AbakusGroup.objects.get(name='Hovedstyret')\n    users = [membership.user for membership in abakus_group.memberships.select_related('user')]\n    emails = [user.email_address for user in users]\n\n    from_name = 'Anonymous' if anonymous else user.full_name\n    from_email = 'Unknown' if anonymous else user.email_address\n\n    send_email.delay(\n        to_email=emails, context={\n            'title': title,\n            'message': message,\n            'from_name': from_name,\n            'from_email': from_email\n        }, subject='Ny henvendelse fra kontaktskjemaet',\n        plain_template='contact/email/contact_form.txt',\n        html_template='contact/email/contact_form.html', from_email=None\n    )\n", "path": "lego/apps/contact/send.py"}], "after_files": [{"content": "from lego.apps.users.constants import GROUP_COMMITTEE, GROUP_GRADE\nfrom lego.apps.users.models import AbakusGroup\nfrom lego.utils.functions import insert_abakus_groups\n\n#  isort:skip\n\"\"\"\nThe structure of the tree is key and a list of two dicts.\nThe first dict is the parameters of the current group\nand the second dict are the children of the current group.\n\nE.g. Abakus: [\n    {\n        description: 'ABAKUSGRUPPE',\n        permissions: ['/sudo/...']\n        ...\n    },\n    {\n        'Webkom': [{\n            description: 'WEBKOMGRUPPE',\n            permissions: ['/sudo/']\n            ...\n        }, {}]\n    }\n]\n\"\"\"\n\ninitial_tree = {\n    'Users': [{\n        'description': 'Brukere p\u00e5 Abakus.no'\n    }, {}],\n    'Abakus': [\n        {\n            'description':\n            'Medlemmer av Abakus',\n            'permissions': [\n                '/sudo/admin/meetings/create', '/sudo/admin/meetinginvitations/create',\n                '/sudo/admin/registrations/create/', '/sudo/admin/events/payment/',\n                '/sudo/admin/comments/create'\n            ]\n        },\n        {\n            'Abakom': [\n                {\n                    'description':\n                    'Medlemmer av Abakom',\n                    'permissions': [\n                        '/sudo/admin/events/',\n                        '/sudo/admin/pools/',\n                        '/sudo/admin/registrations/',\n                        '/sudo/admin/companies/',\n                        '/sudo/admin/joblistings/',\n                    ]\n                },\n                {\n                    'Arrkom': [{\n                        'type': GROUP_COMMITTEE,\n                        'logo_id': 'abakus_arrkom.png'\n                    }, {}],\n                    'backup': [{\n                        'type': GROUP_COMMITTEE,\n                        'logo_id': 'abakus_backup.png'\n                    }, {}],\n                    'Bedkom': [\n                        {\n                            'type':\n                            GROUP_COMMITTEE,\n                            'logo_id':\n                            'abakus_bedkom.png',\n                            'permissions': [\n                                '/sudo/admin/companyinterest/', '/sudo/admin/surveys/',\n                                '/sudo/admin/submissions/'\n                            ]\n                        }, {}\n                    ],\n                    'Fagkom': [\n                        {\n                            'type':\n                            GROUP_COMMITTEE,\n                            'logo_id':\n                            'abakus_fagkom.png',\n                            'permissions': [\n                                '/sudo/admin/companyinterest/', '/sudo/admin/surveys/',\n                                '/sudo/admin/submissions/'\n                            ]\n                        }, {}\n                    ],\n                    'Koskom': [{\n                        'type': GROUP_COMMITTEE,\n                        'logo_id': 'abakus_koskom.png'\n                    }, {}],\n                    'LaBamba': [{\n                        'type': GROUP_COMMITTEE,\n                        'logo_id': 'abakus_labamba.png'\n                    }, {}],\n                    'PR': [{\n                        'type': GROUP_COMMITTEE,\n                        'logo_id': 'abakus_pr.png'\n                    }, {}],\n                    'readme': [{\n                        'type': GROUP_COMMITTEE,\n                        'logo_id': 'abakus_readme.png'\n                    }, {}],\n                    'Webkom': [\n                        {\n                            'type': GROUP_COMMITTEE,\n                            'logo_id': 'abakus_webkom.png',\n                            'permissions': ['/sudo/'],\n                            'text': 'hei'\n                        }, {}\n                    ],\n                    'Hovedstyret': [\n                        {\n                            'logo_id': 'abakus_hs.png',\n                            'permissions': ['/sudo/admin/'],\n                            'contact_email': \"hs@abakus.no\"\n                        }, {}\n                    ]\n                }\n            ],\n            'Interessegrupper':\n            [{\n                'description': 'Super-gruppe for alle interessegrupper i Abakus'\n            }, {}]\n        }\n    ],\n    'Students': [\n        {},\n        {\n            'Datateknologi': [\n                {},\n                {\n                    '1. klasse Datateknologi': [{\n                        'type': GROUP_GRADE\n                    }, {}],\n                    '2. klasse Datateknologi': [{\n                        'type': GROUP_GRADE\n                    }, {}],\n                    '3. klasse Datateknologi': [{\n                        'type': GROUP_GRADE\n                    }, {}],\n                    '4. klasse Datateknologi': [{\n                        'type': GROUP_GRADE\n                    }, {}],\n                    '5. klasse Datateknologi': [{\n                        'type': GROUP_GRADE\n                    }, {}],\n                }\n            ],\n            'Kommunikasjonsteknologi': [\n                {},\n                {\n                    '1. klasse Kommunikasjonsteknologi': [{\n                        'type': GROUP_GRADE\n                    }, {}],\n                    '2. klasse Kommunikasjonsteknologi': [{\n                        'type': GROUP_GRADE\n                    }, {}],\n                    '3. klasse Kommunikasjonsteknologi': [{\n                        'type': GROUP_GRADE\n                    }, {}],\n                    '4. klasse Kommunikasjonsteknologi': [{\n                        'type': GROUP_GRADE\n                    }, {}],\n                    '5. klasse Kommunikasjonsteknologi': [{\n                        'type': GROUP_GRADE\n                    }, {}],\n                }\n            ]\n        }\n    ]\n}\n\n\ndef load_abakus_groups():\n    insert_abakus_groups(initial_tree)\n    AbakusGroup.objects.rebuild()\n", "path": "lego/apps/users/fixtures/initial_abakus_groups.py"}, {"content": "from lego.apps.users.models import AbakusGroup\nfrom lego.utils.tasks import send_email\n\n\ndef send_message(title, message, user, anonymous):\n    \"\"\"\n    Send a message to HS when users posts to the contact form.\n    Don't catch AbakusGroup.DoesNotExist, this notifies us when the group doesn't exist.\n    \"\"\"\n    anonymous = anonymous if user.is_authenticated else True\n    abakus_group = AbakusGroup.objects.get(name='Hovedstyret')\n\n    from_name = 'Anonymous' if anonymous else user.full_name\n    from_email = 'Unknown' if anonymous else user.email_address\n\n    send_email.delay(\n        to_email=abakus_group.contact_email, context={\n            'title': title,\n            'message': message,\n            'from_name': from_name,\n            'from_email': from_email\n        }, subject='Ny henvendelse fra kontaktskjemaet',\n        plain_template='contact/email/contact_form.txt',\n        html_template='contact/email/contact_form.html', from_email=None\n    )\n", "path": "lego/apps/contact/send.py"}]}