We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Alergies should be tied to names in pdf
Request from arrKom among others. 


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `apps/events/pdf_generator.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 from django.contrib.auth.decorators import login_required, user_passes_test
3 
4 from pdfdocument.utils import pdf_response
5 from reportlab.platypus import TableStyle, Paragraph
6 from reportlab.lib import colors
7 from reportlab.lib.styles import getSampleStyleSheet
8 
9 class EventPDF:
10 
11     event = None
12     attendees = None
13     waiters = None
14     attendee_table_data = None
15     waiters_table_data = None
16     allergies_table_data = None
17 
18     def __init__(self, event):
19         self.event = event
20         self.attendees = sorted(event.attendance_event.attendees.all()[:event.attendance_event.max_capacity], key=lambda attendee: attendee.user.last_name)
21         self.waiters = event.wait_list
22         self.attendee_table_data = [(u'Navn', u'Klasse', u'Studie', u'Telefon'), ]
23         self.waiters_table_data = [(u'Navn', u'Klasse', u'Studie', u'Telefon'), ]
24         self.allergies_table_data = ()
25 
26         self.create_attendees_table_data()
27         self.create_waiters_table_data()
28         
29 
30     # Create table data for attendees with a spot
31     def create_attendees_table_data(self):
32 
33         for attendee in self.attendees:
34             user = attendee.user
35             self.attendee_table_data.append((create_body_text("%s, %s" % (user.last_name, user.first_name)),
36                                              user.year, create_body_text(user.get_field_of_study_display()),
37                                              user.phone_number))
38 
39             if user.allergies:
40                 self.allergies_table_data = self.allergies_table_data + (user.allergies,)
41 
42     # Create table data for attendees waiting for a spot
43     def create_waiters_table_data(self):
44 
45         for attendee in self.waiters:
46             user = attendee.user
47             self.waiters_table_data.append((create_body_text("%s, %s" % (user.last_name, user.first_name)),
48                                             user.year, create_body_text(user.get_field_of_study_display()),
49                                             user.phone_number))
50 
51             if user.allergies:
52                 self.allergies_table_data = self.allergies_table_data + (user.allergies,)
53 
54     def attendee_column_widths(self):
55         return (200, 40, 170, 60)
56 
57     def allergies_column_widths(self):
58         return (200, 200)
59 
60     def render_pdf(self):
61         pdf, response = pdf_response(self.event.title + u" attendees")
62         pdf.init_report()
63 
64         pdf.p(self.event.title, style=create_paragraph_style(font_size=18))
65         pdf.spacer(10)
66         pdf.p(self.event.event_start.strftime('%d. %B %Y'), create_paragraph_style(font_size=9))
67         pdf.spacer(height=25)
68 
69         pdf.p(u"Påmeldte", style=create_paragraph_style(font_size=14))
70         pdf.spacer(height=20)
71         pdf.table(self.attendee_table_data, self.attendee_column_widths(), style=get_table_style())
72         pdf.spacer(height=25)
73 
74         pdf.p(u"Venteliste", style=create_paragraph_style(font_size=14))
75         pdf.spacer(height=20)
76         pdf.table(self.waiters_table_data, self.attendee_column_widths(), style=get_table_style())
77         pdf.spacer(height=25)
78 
79         pdf.p(u"Allergier", style=create_paragraph_style(font_size=14))
80         pdf.spacer(height=12)
81         pdf.ul(self.allergies_table_data)
82 
83         pdf.generate()
84         return response
85 
86 
87 # Table style for framed table with grids
88 def get_table_style():
89     return TableStyle(
90         [
91             ('GRID',(0,0),(-1,-1),0.5,colors.grey),
92             ('BOX',(0,0),(-1,-1),1,colors.black),
93         ]
94     )
95 
96 # Normal paragraph
97 def create_paragraph_style(font_name='Helvetica', font_size=10, color=colors.black):
98     style = getSampleStyleSheet()['Normal']
99     style.fontSize = font_size
100     style.fontName = font_name
101     style.textColor = color
102 
103     return style
104 
105 # Paragraph with word-wrapping, useful for tables
106 def create_body_text(text, font_name='Helvetica', font_size=10, color=colors.black):
107     style = getSampleStyleSheet()['BodyText']
108     style.fontSize = font_size
109     style.fontName = font_name
110     style.textColor = color
111 
112     return Paragraph(text, style=style)
```
--- 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/apps/events/pdf_generator.py b/apps/events/pdf_generator.py
--- a/apps/events/pdf_generator.py
+++ b/apps/events/pdf_generator.py
@@ -19,8 +19,8 @@
         self.event = event
         self.attendees = sorted(event.attendance_event.attendees.all()[:event.attendance_event.max_capacity], key=lambda attendee: attendee.user.last_name)
         self.waiters = event.wait_list
-        self.attendee_table_data = [(u'Navn', u'Klasse', u'Studie', u'Telefon'), ]
-        self.waiters_table_data = [(u'Navn', u'Klasse', u'Studie', u'Telefon'), ]
+        self.attendee_table_data = [(u'Navn', u'Klasse', u'Studie', u'Telefon', u'Allergier'), ]
+        self.waiters_table_data = [(u'Navn', u'Klasse', u'Studie', u'Telefon',  u'Allergier'), ]
         self.allergies_table_data = ()
 
         self.create_attendees_table_data()
@@ -34,7 +34,7 @@
             user = attendee.user
             self.attendee_table_data.append((create_body_text("%s, %s" % (user.last_name, user.first_name)),
                                              user.year, create_body_text(user.get_field_of_study_display()),
-                                             user.phone_number))
+                                             user.phone_number, user.allergies))
 
             if user.allergies:
                 self.allergies_table_data = self.allergies_table_data + (user.allergies,)
@@ -46,13 +46,13 @@
             user = attendee.user
             self.waiters_table_data.append((create_body_text("%s, %s" % (user.last_name, user.first_name)),
                                             user.year, create_body_text(user.get_field_of_study_display()),
-                                            user.phone_number))
+                                            user.phone_number, user.allergies))
 
             if user.allergies:
                 self.allergies_table_data = self.allergies_table_data + (user.allergies,)
 
     def attendee_column_widths(self):
-        return (200, 40, 170, 60)
+        return (150, 40, 170, 60, 100)
 
     def allergies_column_widths(self):
         return (200, 200)

{"golden_diff": "diff --git a/apps/events/pdf_generator.py b/apps/events/pdf_generator.py\n--- a/apps/events/pdf_generator.py\n+++ b/apps/events/pdf_generator.py\n@@ -19,8 +19,8 @@\n         self.event = event\n         self.attendees = sorted(event.attendance_event.attendees.all()[:event.attendance_event.max_capacity], key=lambda attendee: attendee.user.last_name)\n         self.waiters = event.wait_list\n-        self.attendee_table_data = [(u'Navn', u'Klasse', u'Studie', u'Telefon'), ]\n-        self.waiters_table_data = [(u'Navn', u'Klasse', u'Studie', u'Telefon'), ]\n+        self.attendee_table_data = [(u'Navn', u'Klasse', u'Studie', u'Telefon', u'Allergier'), ]\n+        self.waiters_table_data = [(u'Navn', u'Klasse', u'Studie', u'Telefon',  u'Allergier'), ]\n         self.allergies_table_data = ()\n \n         self.create_attendees_table_data()\n@@ -34,7 +34,7 @@\n             user = attendee.user\n             self.attendee_table_data.append((create_body_text(\"%s, %s\" % (user.last_name, user.first_name)),\n                                              user.year, create_body_text(user.get_field_of_study_display()),\n-                                             user.phone_number))\n+                                             user.phone_number, user.allergies))\n \n             if user.allergies:\n                 self.allergies_table_data = self.allergies_table_data + (user.allergies,)\n@@ -46,13 +46,13 @@\n             user = attendee.user\n             self.waiters_table_data.append((create_body_text(\"%s, %s\" % (user.last_name, user.first_name)),\n                                             user.year, create_body_text(user.get_field_of_study_display()),\n-                                            user.phone_number))\n+                                            user.phone_number, user.allergies))\n \n             if user.allergies:\n                 self.allergies_table_data = self.allergies_table_data + (user.allergies,)\n \n     def attendee_column_widths(self):\n-        return (200, 40, 170, 60)\n+        return (150, 40, 170, 60, 100)\n \n     def allergies_column_widths(self):\n         return (200, 200)\n", "issue": "Alergies should be tied to names in pdf\nRequest from arrKom among others. \n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\nfrom django.contrib.auth.decorators import login_required, user_passes_test\n\nfrom pdfdocument.utils import pdf_response\nfrom reportlab.platypus import TableStyle, Paragraph\nfrom reportlab.lib import colors\nfrom reportlab.lib.styles import getSampleStyleSheet\n\nclass EventPDF:\n\n    event = None\n    attendees = None\n    waiters = None\n    attendee_table_data = None\n    waiters_table_data = None\n    allergies_table_data = None\n\n    def __init__(self, event):\n        self.event = event\n        self.attendees = sorted(event.attendance_event.attendees.all()[:event.attendance_event.max_capacity], key=lambda attendee: attendee.user.last_name)\n        self.waiters = event.wait_list\n        self.attendee_table_data = [(u'Navn', u'Klasse', u'Studie', u'Telefon'), ]\n        self.waiters_table_data = [(u'Navn', u'Klasse', u'Studie', u'Telefon'), ]\n        self.allergies_table_data = ()\n\n        self.create_attendees_table_data()\n        self.create_waiters_table_data()\n        \n\n    # Create table data for attendees with a spot\n    def create_attendees_table_data(self):\n\n        for attendee in self.attendees:\n            user = attendee.user\n            self.attendee_table_data.append((create_body_text(\"%s, %s\" % (user.last_name, user.first_name)),\n                                             user.year, create_body_text(user.get_field_of_study_display()),\n                                             user.phone_number))\n\n            if user.allergies:\n                self.allergies_table_data = self.allergies_table_data + (user.allergies,)\n\n    # Create table data for attendees waiting for a spot\n    def create_waiters_table_data(self):\n\n        for attendee in self.waiters:\n            user = attendee.user\n            self.waiters_table_data.append((create_body_text(\"%s, %s\" % (user.last_name, user.first_name)),\n                                            user.year, create_body_text(user.get_field_of_study_display()),\n                                            user.phone_number))\n\n            if user.allergies:\n                self.allergies_table_data = self.allergies_table_data + (user.allergies,)\n\n    def attendee_column_widths(self):\n        return (200, 40, 170, 60)\n\n    def allergies_column_widths(self):\n        return (200, 200)\n\n    def render_pdf(self):\n        pdf, response = pdf_response(self.event.title + u\" attendees\")\n        pdf.init_report()\n\n        pdf.p(self.event.title, style=create_paragraph_style(font_size=18))\n        pdf.spacer(10)\n        pdf.p(self.event.event_start.strftime('%d. %B %Y'), create_paragraph_style(font_size=9))\n        pdf.spacer(height=25)\n\n        pdf.p(u\"P\u00e5meldte\", style=create_paragraph_style(font_size=14))\n        pdf.spacer(height=20)\n        pdf.table(self.attendee_table_data, self.attendee_column_widths(), style=get_table_style())\n        pdf.spacer(height=25)\n\n        pdf.p(u\"Venteliste\", style=create_paragraph_style(font_size=14))\n        pdf.spacer(height=20)\n        pdf.table(self.waiters_table_data, self.attendee_column_widths(), style=get_table_style())\n        pdf.spacer(height=25)\n\n        pdf.p(u\"Allergier\", style=create_paragraph_style(font_size=14))\n        pdf.spacer(height=12)\n        pdf.ul(self.allergies_table_data)\n\n        pdf.generate()\n        return response\n\n\n# Table style for framed table with grids\ndef get_table_style():\n    return TableStyle(\n        [\n            ('GRID',(0,0),(-1,-1),0.5,colors.grey),\n            ('BOX',(0,0),(-1,-1),1,colors.black),\n        ]\n    )\n\n# Normal paragraph\ndef create_paragraph_style(font_name='Helvetica', font_size=10, color=colors.black):\n    style = getSampleStyleSheet()['Normal']\n    style.fontSize = font_size\n    style.fontName = font_name\n    style.textColor = color\n\n    return style\n\n# Paragraph with word-wrapping, useful for tables\ndef create_body_text(text, font_name='Helvetica', font_size=10, color=colors.black):\n    style = getSampleStyleSheet()['BodyText']\n    style.fontSize = font_size\n    style.fontName = font_name\n    style.textColor = color\n\n    return Paragraph(text, style=style)", "path": "apps/events/pdf_generator.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\nfrom django.contrib.auth.decorators import login_required, user_passes_test\n\nfrom pdfdocument.utils import pdf_response\nfrom reportlab.platypus import TableStyle, Paragraph\nfrom reportlab.lib import colors\nfrom reportlab.lib.styles import getSampleStyleSheet\n\nclass EventPDF:\n\n    event = None\n    attendees = None\n    waiters = None\n    attendee_table_data = None\n    waiters_table_data = None\n    allergies_table_data = None\n\n    def __init__(self, event):\n        self.event = event\n        self.attendees = sorted(event.attendance_event.attendees.all()[:event.attendance_event.max_capacity], key=lambda attendee: attendee.user.last_name)\n        self.waiters = event.wait_list\n        self.attendee_table_data = [(u'Navn', u'Klasse', u'Studie', u'Telefon', u'Allergier'), ]\n        self.waiters_table_data = [(u'Navn', u'Klasse', u'Studie', u'Telefon',  u'Allergier'), ]\n        self.allergies_table_data = ()\n\n        self.create_attendees_table_data()\n        self.create_waiters_table_data()\n        \n\n    # Create table data for attendees with a spot\n    def create_attendees_table_data(self):\n\n        for attendee in self.attendees:\n            user = attendee.user\n            self.attendee_table_data.append((create_body_text(\"%s, %s\" % (user.last_name, user.first_name)),\n                                             user.year, create_body_text(user.get_field_of_study_display()),\n                                             user.phone_number, user.allergies))\n\n            if user.allergies:\n                self.allergies_table_data = self.allergies_table_data + (user.allergies,)\n\n    # Create table data for attendees waiting for a spot\n    def create_waiters_table_data(self):\n\n        for attendee in self.waiters:\n            user = attendee.user\n            self.waiters_table_data.append((create_body_text(\"%s, %s\" % (user.last_name, user.first_name)),\n                                            user.year, create_body_text(user.get_field_of_study_display()),\n                                            user.phone_number, user.allergies))\n\n            if user.allergies:\n                self.allergies_table_data = self.allergies_table_data + (user.allergies,)\n\n    def attendee_column_widths(self):\n        return (150, 40, 170, 60, 100)\n\n    def allergies_column_widths(self):\n        return (200, 200)\n\n    def render_pdf(self):\n        pdf, response = pdf_response(self.event.title + u\" attendees\")\n        pdf.init_report()\n\n        pdf.p(self.event.title, style=create_paragraph_style(font_size=18))\n        pdf.spacer(10)\n        pdf.p(self.event.event_start.strftime('%d. %B %Y'), create_paragraph_style(font_size=9))\n        pdf.spacer(height=25)\n\n        pdf.p(u\"P\u00e5meldte\", style=create_paragraph_style(font_size=14))\n        pdf.spacer(height=20)\n        pdf.table(self.attendee_table_data, self.attendee_column_widths(), style=get_table_style())\n        pdf.spacer(height=25)\n\n        pdf.p(u\"Venteliste\", style=create_paragraph_style(font_size=14))\n        pdf.spacer(height=20)\n        pdf.table(self.waiters_table_data, self.attendee_column_widths(), style=get_table_style())\n        pdf.spacer(height=25)\n\n        pdf.p(u\"Allergier\", style=create_paragraph_style(font_size=14))\n        pdf.spacer(height=12)\n        pdf.ul(self.allergies_table_data)\n\n        pdf.generate()\n        return response\n\n\n# Table style for framed table with grids\ndef get_table_style():\n    return TableStyle(\n        [\n            ('GRID',(0,0),(-1,-1),0.5,colors.grey),\n            ('BOX',(0,0),(-1,-1),1,colors.black),\n        ]\n    )\n\n# Normal paragraph\ndef create_paragraph_style(font_name='Helvetica', font_size=10, color=colors.black):\n    style = getSampleStyleSheet()['Normal']\n    style.fontSize = font_size\n    style.fontName = font_name\n    style.textColor = color\n\n    return style\n\n# Paragraph with word-wrapping, useful for tables\ndef create_body_text(text, font_name='Helvetica', font_size=10, color=colors.black):\n    style = getSampleStyleSheet()['BodyText']\n    style.fontSize = font_size\n    style.fontName = font_name\n    style.textColor = color\n\n    return Paragraph(text, style=style)", "path": "apps/events/pdf_generator.py"}]}