We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Problème avec les liens vers les auteur.ic.es des suggestions
Quand quelqu'un fait une suggestion depuis le site, le lien pour avoir le nom de la personne ne fonctionne pas.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `server/apps/home/forms.py`
Content:
```
1 from django import forms
2 
3 class SuggestionForm(forms.Form):
4     title = forms.CharField(max_length=50, required=True)
5     description = forms.CharField(widget=forms.Textarea)
6
```

Path: `server/apps/utils/github.py`
Content:
```
1 import requests
2 from django.conf import settings
3 
4 
5 def create_issue(title: str, body: str):
6     issue = {
7         'title': title,
8         'body': body
9     }
10     resp = requests.post(f'https://api.github.com/repos/{settings.GITHUB_REPO}/issues',
11                          json=issue, auth=(settings.GITHUB_USER, settings.GITHUB_TOKEN))
12     if resp.status_code != 201:
13         raise Exception(f'Error while posting issue to Github: {resp.reason}')
14     return resp.json()['number']
15 
16 
17 def close_issue(number: int):
18     """Function to close an issue in the repo."""
19     update = {'state': 'closed'}
20     requests.post(f'https://api.github.com/repos/{settings.GITHUB_REPO}/issues/{number}',
21                   json=update, auth=(settings.GITHUB_USER, settings.GITHUB_TOKEN))
22
```

Path: `server/apps/home/views.py`
Content:
```
1 from datetime import *
2 from typing import List
3 from django.contrib.sites.shortcuts import get_current_site
4 from django.db.models.query import QuerySet
5 from django.shortcuts import render, redirect
6 from django.views.generic import TemplateView, FormView
7 from django.contrib import messages
8 from django.contrib.auth.mixins import LoginRequiredMixin
9 
10 from apps.event.models import BaseEvent
11 from apps.post.models import Post
12 from apps.utils.github import create_issue
13 
14 from .forms import SuggestionForm
15 
16 
17 class HomeView(LoginRequiredMixin, TemplateView):
18     template_name = 'home/home.html'
19 
20     def get_context_data(self, **kwargs):
21         # Call the base implementation first to get a context
22         context = super().get_context_data(**kwargs)
23         posts: List[Post] = Post.objects.filter(
24             publication_date__gte=date.today()-timedelta(days=10)).order_by('-publication_date')
25         context['posts'] = [
26             post for post in posts if post.can_view(self.request.user)]
27         return context
28 
29 
30 class SuggestionView(LoginRequiredMixin, FormView):
31     template_name = 'home/suggestions.html'
32     form_class = SuggestionForm
33 
34     def form_valid(self, form):
35         create_issue(
36             title=form.cleaned_data['title'],
37             body=f"{form.cleaned_data['description']} <br/> <a href='http://{get_current_site(self.request)}{self.request.user.student.get_absolute_url}'>Clique pour découvrir qui propose ça.</a>"
38         )
39         messages.success(
40             self.request, 'Votre suggestion a été enregistrée merci')
41         return redirect('home:home')
42 
43 
44 def handler404(request, *args, **argv):
45     response = render(request, '404.html', context={}, status=404)
46     return response
47 
48 
49 def handler500(request, *args, **argv):
50     response = render(request, '500.html', context={},
51                       status=500)
52     return response
53 
54 
55 def event_sort(events, request):
56     tri = {}
57     jours = ["Lundi", "Mardi", "Mercredi",
58              "Jeudi", "Vendredi", "Samedi", "Dimanche"]
59     mois = ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin",
60             "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"]
61     for event in events:
62         if event.date.date() == date.today():
63             if "Aujourd'hui" in tri:
64                 tri["Aujourd'hui"].append(
65                     (event, event.is_participating(request.user)))
66             else:
67                 tri["Aujourd'hui"] = list()
68                 tri["Aujourd'hui"].append(
69                     (event, event.is_participating(request.user)))
70         elif event.date.date() == (date.today()+timedelta(days=1)):
71             if "Demain" in tri:
72                 tri["Demain"].append(
73                     (event, event.is_participating(request.user)))
74             else:
75                 tri["Demain"] = list()
76                 tri["Demain"].append(
77                     (event, event.is_participating(request.user)))
78         else:
79             written_date = jours[event.date.weekday(
80             )] + " " + str(event.date.day) + " " + mois[event.date.month-1]
81             if written_date in tri:
82                 tri[written_date].append(
83                     (event, event.is_participating(request.user)))
84             else:
85                 tri[written_date] = list()
86                 tri[written_date].append(
87                     (event, event.is_participating(request.user)))
88     return tri
89
```
--- 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/server/apps/home/forms.py b/server/apps/home/forms.py
--- a/server/apps/home/forms.py
+++ b/server/apps/home/forms.py
@@ -1,5 +1,14 @@
 from django import forms
 
+TYPE_CHOICES = (
+    (1, ("Bug")),
+    (2, ("Suggestion"))
+)
+
+
 class SuggestionForm(forms.Form):
     title = forms.CharField(max_length=50, required=True)
     description = forms.CharField(widget=forms.Textarea)
+    suggestionOrBug = forms.ChoiceField(label="Type",
+                                        choices=TYPE_CHOICES,
+                                        required=True)
diff --git a/server/apps/home/views.py b/server/apps/home/views.py
--- a/server/apps/home/views.py
+++ b/server/apps/home/views.py
@@ -34,7 +34,8 @@
     def form_valid(self, form):
         create_issue(
             title=form.cleaned_data['title'],
-            body=f"{form.cleaned_data['description']} <br/> <a href='http://{get_current_site(self.request)}{self.request.user.student.get_absolute_url}'>Clique pour découvrir qui propose ça.</a>"
+            body=f"{form.cleaned_data['description']} <br/> [Clique pour découvrir qui propose ça.](http://{get_current_site(self.request)}{self.request.user.student.get_absolute_url()})",
+            label=form.cleaned_data['suggestionOrBug']
         )
         messages.success(
             self.request, 'Votre suggestion a été enregistrée merci')
diff --git a/server/apps/utils/github.py b/server/apps/utils/github.py
--- a/server/apps/utils/github.py
+++ b/server/apps/utils/github.py
@@ -2,15 +2,18 @@
 from django.conf import settings
 
 
-def create_issue(title: str, body: str):
+def create_issue(title: str, body: str, label):
+    label = "bug" if int(label) == 1 else "suggestion"
     issue = {
         'title': title,
-        'body': body
+        'body': body,
+        'labels': [label]
     }
     resp = requests.post(f'https://api.github.com/repos/{settings.GITHUB_REPO}/issues',
                          json=issue, auth=(settings.GITHUB_USER, settings.GITHUB_TOKEN))
     if resp.status_code != 201:
-        raise Exception(f'Error while posting issue to Github: {resp.reason}')
+        raise Exception(
+            f'Error while posting issue to Github: {resp.reason}')
     return resp.json()['number']

{"golden_diff": "diff --git a/server/apps/home/forms.py b/server/apps/home/forms.py\n--- a/server/apps/home/forms.py\n+++ b/server/apps/home/forms.py\n@@ -1,5 +1,14 @@\n from django import forms\n \n+TYPE_CHOICES = (\n+    (1, (\"Bug\")),\n+    (2, (\"Suggestion\"))\n+)\n+\n+\n class SuggestionForm(forms.Form):\n     title = forms.CharField(max_length=50, required=True)\n     description = forms.CharField(widget=forms.Textarea)\n+    suggestionOrBug = forms.ChoiceField(label=\"Type\",\n+                                        choices=TYPE_CHOICES,\n+                                        required=True)\ndiff --git a/server/apps/home/views.py b/server/apps/home/views.py\n--- a/server/apps/home/views.py\n+++ b/server/apps/home/views.py\n@@ -34,7 +34,8 @@\n     def form_valid(self, form):\n         create_issue(\n             title=form.cleaned_data['title'],\n-            body=f\"{form.cleaned_data['description']} <br/> <a href='http://{get_current_site(self.request)}{self.request.user.student.get_absolute_url}'>Clique pour d\u00e9couvrir qui propose \u00e7a.</a>\"\n+            body=f\"{form.cleaned_data['description']} <br/> [Clique pour d\u00e9couvrir qui propose \u00e7a.](http://{get_current_site(self.request)}{self.request.user.student.get_absolute_url()})\",\n+            label=form.cleaned_data['suggestionOrBug']\n         )\n         messages.success(\n             self.request, 'Votre suggestion a \u00e9t\u00e9 enregistr\u00e9e merci')\ndiff --git a/server/apps/utils/github.py b/server/apps/utils/github.py\n--- a/server/apps/utils/github.py\n+++ b/server/apps/utils/github.py\n@@ -2,15 +2,18 @@\n from django.conf import settings\n \n \n-def create_issue(title: str, body: str):\n+def create_issue(title: str, body: str, label):\n+    label = \"bug\" if int(label) == 1 else \"suggestion\"\n     issue = {\n         'title': title,\n-        'body': body\n+        'body': body,\n+        'labels': [label]\n     }\n     resp = requests.post(f'https://api.github.com/repos/{settings.GITHUB_REPO}/issues',\n                          json=issue, auth=(settings.GITHUB_USER, settings.GITHUB_TOKEN))\n     if resp.status_code != 201:\n-        raise Exception(f'Error while posting issue to Github: {resp.reason}')\n+        raise Exception(\n+            f'Error while posting issue to Github: {resp.reason}')\n     return resp.json()['number']\n", "issue": "Probl\u00e8me avec les liens vers les auteur.ic.es des suggestions\nQuand quelqu'un fait une suggestion depuis le site, le lien pour avoir le nom de la personne ne fonctionne pas.\n", "before_files": [{"content": "from django import forms\n\nclass SuggestionForm(forms.Form):\n    title = forms.CharField(max_length=50, required=True)\n    description = forms.CharField(widget=forms.Textarea)\n", "path": "server/apps/home/forms.py"}, {"content": "import requests\nfrom django.conf import settings\n\n\ndef create_issue(title: str, body: str):\n    issue = {\n        'title': title,\n        'body': body\n    }\n    resp = requests.post(f'https://api.github.com/repos/{settings.GITHUB_REPO}/issues',\n                         json=issue, auth=(settings.GITHUB_USER, settings.GITHUB_TOKEN))\n    if resp.status_code != 201:\n        raise Exception(f'Error while posting issue to Github: {resp.reason}')\n    return resp.json()['number']\n\n\ndef close_issue(number: int):\n    \"\"\"Function to close an issue in the repo.\"\"\"\n    update = {'state': 'closed'}\n    requests.post(f'https://api.github.com/repos/{settings.GITHUB_REPO}/issues/{number}',\n                  json=update, auth=(settings.GITHUB_USER, settings.GITHUB_TOKEN))\n", "path": "server/apps/utils/github.py"}, {"content": "from datetime import *\nfrom typing import List\nfrom django.contrib.sites.shortcuts import get_current_site\nfrom django.db.models.query import QuerySet\nfrom django.shortcuts import render, redirect\nfrom django.views.generic import TemplateView, FormView\nfrom django.contrib import messages\nfrom django.contrib.auth.mixins import LoginRequiredMixin\n\nfrom apps.event.models import BaseEvent\nfrom apps.post.models import Post\nfrom apps.utils.github import create_issue\n\nfrom .forms import SuggestionForm\n\n\nclass HomeView(LoginRequiredMixin, TemplateView):\n    template_name = 'home/home.html'\n\n    def get_context_data(self, **kwargs):\n        # Call the base implementation first to get a context\n        context = super().get_context_data(**kwargs)\n        posts: List[Post] = Post.objects.filter(\n            publication_date__gte=date.today()-timedelta(days=10)).order_by('-publication_date')\n        context['posts'] = [\n            post for post in posts if post.can_view(self.request.user)]\n        return context\n\n\nclass SuggestionView(LoginRequiredMixin, FormView):\n    template_name = 'home/suggestions.html'\n    form_class = SuggestionForm\n\n    def form_valid(self, form):\n        create_issue(\n            title=form.cleaned_data['title'],\n            body=f\"{form.cleaned_data['description']} <br/> <a href='http://{get_current_site(self.request)}{self.request.user.student.get_absolute_url}'>Clique pour d\u00e9couvrir qui propose \u00e7a.</a>\"\n        )\n        messages.success(\n            self.request, 'Votre suggestion a \u00e9t\u00e9 enregistr\u00e9e merci')\n        return redirect('home:home')\n\n\ndef handler404(request, *args, **argv):\n    response = render(request, '404.html', context={}, status=404)\n    return response\n\n\ndef handler500(request, *args, **argv):\n    response = render(request, '500.html', context={},\n                      status=500)\n    return response\n\n\ndef event_sort(events, request):\n    tri = {}\n    jours = [\"Lundi\", \"Mardi\", \"Mercredi\",\n             \"Jeudi\", \"Vendredi\", \"Samedi\", \"Dimanche\"]\n    mois = [\"Janvier\", \"F\u00e9vrier\", \"Mars\", \"Avril\", \"Mai\", \"Juin\",\n            \"Juillet\", \"Ao\u00fbt\", \"Septembre\", \"Octobre\", \"Novembre\", \"D\u00e9cembre\"]\n    for event in events:\n        if event.date.date() == date.today():\n            if \"Aujourd'hui\" in tri:\n                tri[\"Aujourd'hui\"].append(\n                    (event, event.is_participating(request.user)))\n            else:\n                tri[\"Aujourd'hui\"] = list()\n                tri[\"Aujourd'hui\"].append(\n                    (event, event.is_participating(request.user)))\n        elif event.date.date() == (date.today()+timedelta(days=1)):\n            if \"Demain\" in tri:\n                tri[\"Demain\"].append(\n                    (event, event.is_participating(request.user)))\n            else:\n                tri[\"Demain\"] = list()\n                tri[\"Demain\"].append(\n                    (event, event.is_participating(request.user)))\n        else:\n            written_date = jours[event.date.weekday(\n            )] + \" \" + str(event.date.day) + \" \" + mois[event.date.month-1]\n            if written_date in tri:\n                tri[written_date].append(\n                    (event, event.is_participating(request.user)))\n            else:\n                tri[written_date] = list()\n                tri[written_date].append(\n                    (event, event.is_participating(request.user)))\n    return tri\n", "path": "server/apps/home/views.py"}], "after_files": [{"content": "from django import forms\n\nTYPE_CHOICES = (\n    (1, (\"Bug\")),\n    (2, (\"Suggestion\"))\n)\n\n\nclass SuggestionForm(forms.Form):\n    title = forms.CharField(max_length=50, required=True)\n    description = forms.CharField(widget=forms.Textarea)\n    suggestionOrBug = forms.ChoiceField(label=\"Type\",\n                                        choices=TYPE_CHOICES,\n                                        required=True)\n", "path": "server/apps/home/forms.py"}, {"content": "import requests\nfrom django.conf import settings\n\n\ndef create_issue(title: str, body: str, label):\n    label = \"bug\" if int(label) == 1 else \"suggestion\"\n    issue = {\n        'title': title,\n        'body': body,\n        'labels': [label]\n    }\n    resp = requests.post(f'https://api.github.com/repos/{settings.GITHUB_REPO}/issues',\n                         json=issue, auth=(settings.GITHUB_USER, settings.GITHUB_TOKEN))\n    if resp.status_code != 201:\n        raise Exception(\n            f'Error while posting issue to Github: {resp.reason}')\n    return resp.json()['number']\n\n\ndef close_issue(number: int):\n    \"\"\"Function to close an issue in the repo.\"\"\"\n    update = {'state': 'closed'}\n    requests.post(f'https://api.github.com/repos/{settings.GITHUB_REPO}/issues/{number}',\n                  json=update, auth=(settings.GITHUB_USER, settings.GITHUB_TOKEN))\n", "path": "server/apps/utils/github.py"}, {"content": "from datetime import *\nfrom typing import List\nfrom django.contrib.sites.shortcuts import get_current_site\nfrom django.db.models.query import QuerySet\nfrom django.shortcuts import render, redirect\nfrom django.views.generic import TemplateView, FormView\nfrom django.contrib import messages\nfrom django.contrib.auth.mixins import LoginRequiredMixin\n\nfrom apps.event.models import BaseEvent\nfrom apps.post.models import Post\nfrom apps.utils.github import create_issue\n\nfrom .forms import SuggestionForm\n\n\nclass HomeView(LoginRequiredMixin, TemplateView):\n    template_name = 'home/home.html'\n\n    def get_context_data(self, **kwargs):\n        # Call the base implementation first to get a context\n        context = super().get_context_data(**kwargs)\n        posts: List[Post] = Post.objects.filter(\n            publication_date__gte=date.today()-timedelta(days=10)).order_by('-publication_date')\n        context['posts'] = [\n            post for post in posts if post.can_view(self.request.user)]\n        return context\n\n\nclass SuggestionView(LoginRequiredMixin, FormView):\n    template_name = 'home/suggestions.html'\n    form_class = SuggestionForm\n\n    def form_valid(self, form):\n        create_issue(\n            title=form.cleaned_data['title'],\n            body=f\"{form.cleaned_data['description']} <br/> [Clique pour d\u00e9couvrir qui propose \u00e7a.](http://{get_current_site(self.request)}{self.request.user.student.get_absolute_url()})\",\n            label=form.cleaned_data['suggestionOrBug']\n        )\n        messages.success(\n            self.request, 'Votre suggestion a \u00e9t\u00e9 enregistr\u00e9e merci')\n        return redirect('home:home')\n\n\ndef handler404(request, *args, **argv):\n    response = render(request, '404.html', context={}, status=404)\n    return response\n\n\ndef handler500(request, *args, **argv):\n    response = render(request, '500.html', context={},\n                      status=500)\n    return response\n\n\ndef event_sort(events, request):\n    tri = {}\n    jours = [\"Lundi\", \"Mardi\", \"Mercredi\",\n             \"Jeudi\", \"Vendredi\", \"Samedi\", \"Dimanche\"]\n    mois = [\"Janvier\", \"F\u00e9vrier\", \"Mars\", \"Avril\", \"Mai\", \"Juin\",\n            \"Juillet\", \"Ao\u00fbt\", \"Septembre\", \"Octobre\", \"Novembre\", \"D\u00e9cembre\"]\n    for event in events:\n        if event.date.date() == date.today():\n            if \"Aujourd'hui\" in tri:\n                tri[\"Aujourd'hui\"].append(\n                    (event, event.is_participating(request.user)))\n            else:\n                tri[\"Aujourd'hui\"] = list()\n                tri[\"Aujourd'hui\"].append(\n                    (event, event.is_participating(request.user)))\n        elif event.date.date() == (date.today()+timedelta(days=1)):\n            if \"Demain\" in tri:\n                tri[\"Demain\"].append(\n                    (event, event.is_participating(request.user)))\n            else:\n                tri[\"Demain\"] = list()\n                tri[\"Demain\"].append(\n                    (event, event.is_participating(request.user)))\n        else:\n            written_date = jours[event.date.weekday(\n            )] + \" \" + str(event.date.day) + \" \" + mois[event.date.month-1]\n            if written_date in tri:\n                tri[written_date].append(\n                    (event, event.is_participating(request.user)))\n            else:\n                tri[written_date] = list()\n                tri[written_date].append(\n                    (event, event.is_participating(request.user)))\n    return tri\n", "path": "server/apps/home/views.py"}]}