We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Speak to legal team about updating our T&Cs for GDPR


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `portal/admin.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 # Code for Life
3 #
4 # Copyright (C) 2018, Ocado Innovation Limited
5 #
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU Affero General Public License as
8 # published by the Free Software Foundation, either version 3 of the
9 # License, or (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU Affero General Public License for more details.
15 #
16 # You should have received a copy of the GNU Affero General Public License
17 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 #
19 # ADDITIONAL TERMS – Section 7 GNU General Public Licence
20 #
21 # This licence does not grant any right, title or interest in any “Ocado” logos,
22 # trade names or the trademark “Ocado” or any other trademarks or domain names
23 # owned by Ocado Innovation Limited or the Ocado group of companies or any other
24 # distinctive brand features of “Ocado” as may be secured from time to time. You
25 # must not distribute any modification of this program using the trademark
26 # “Ocado” or claim any affiliation or association with Ocado or its employees.
27 #
28 # You are not authorised to use the name Ocado (or any of its trade names) or
29 # the names of any author or contributor in advertising or for publicity purposes
30 # pertaining to the distribution of this program, without the prior written
31 # authorisation of Ocado.
32 #
33 # Any propagation, distribution or conveyance of this program must include this
34 # copyright notice and these terms. You must not misrepresent the origins of this
35 # program; modified versions of the program must be marked as such and not
36 # identified as the original program.
37 from django.contrib import admin
38 from django.contrib.auth.models import User
39 from django.contrib.auth.admin import UserAdmin
40 
41 
42 from portal.models import Class, Student, Guardian, Teacher, School, UserProfile, FrontPageNews, EmailVerification
43 
44 
45 class ClassAdmin(admin.ModelAdmin):
46     search_fields = ['name', 'teacher__new_user__first_name', 'teacher__new_user__last_name']
47     list_filter = ['teacher']
48     readonly_fields = ['teacher']
49 
50 
51 class SchoolAdmin(admin.ModelAdmin):
52     search_fields = ['name', 'country', 'postcode', 'town']
53     list_filter = ['postcode', 'country']
54 
55 
56 class StudentAdmin(admin.ModelAdmin):
57     search_fields = ['new_user__first_name', 'new_user__last_name']
58     list_filter = ['class_field', 'class_field__teacher']
59     readonly_fields = ['user', 'new_user']
60     raw_id_fields = ['class_field', 'pending_class_request']
61 
62 
63 class TeacherAdmin(admin.ModelAdmin):
64     search_fields = ['new_user__first_name', 'new_user__last_name']
65     list_filter = ['school']
66     readonly_fields = ['user', 'new_user']
67     raw_id_fields = ['school', 'pending_join_request']
68 
69 
70 class UserProfileAdmin(admin.ModelAdmin):
71     search_fields = ['user__first_name', 'user__last_name', 'new_username', 'user__date_joined']
72     list_filter = ['user__date_joined']
73     list_display = ['user', 'joined_recently']
74     readonly_fields = ['user']
75 
76 
77 class EmailVerificationAdmin(admin.ModelAdmin):
78     search_fields = ['new_user']
79 
80 
81 UserAdmin.list_display += ('date_joined',)
82 UserAdmin.list_filter += ('date_joined',)
83 
84 
85 admin.site.register(Class, ClassAdmin)
86 admin.site.register(Student, StudentAdmin)
87 admin.site.register(Guardian)
88 admin.site.register(Teacher, TeacherAdmin)
89 admin.site.register(School, SchoolAdmin)
90 admin.site.unregister(User)
91 admin.site.register(User, UserAdmin)
92 admin.site.register(UserProfile, UserProfileAdmin)
93 admin.site.register(FrontPageNews)
94 admin.site.register(EmailVerification, EmailVerificationAdmin)
95
```
--- 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/portal/admin.py b/portal/admin.py
--- a/portal/admin.py
+++ b/portal/admin.py
@@ -68,14 +68,14 @@
 
 
 class UserProfileAdmin(admin.ModelAdmin):
-    search_fields = ['user__first_name', 'user__last_name', 'new_username', 'user__date_joined']
+    search_fields = ['user__first_name', 'user__last_name', 'user__username', 'user__date_joined']
     list_filter = ['user__date_joined']
     list_display = ['user', 'joined_recently']
     readonly_fields = ['user']
 
 
 class EmailVerificationAdmin(admin.ModelAdmin):
-    search_fields = ['new_user']
+    search_fields = ['user__first_name', 'user__last_name', 'user__username', 'user__date_joined']
 
 
 UserAdmin.list_display += ('date_joined',)

{"golden_diff": "diff --git a/portal/admin.py b/portal/admin.py\n--- a/portal/admin.py\n+++ b/portal/admin.py\n@@ -68,14 +68,14 @@\n \n \n class UserProfileAdmin(admin.ModelAdmin):\n-    search_fields = ['user__first_name', 'user__last_name', 'new_username', 'user__date_joined']\n+    search_fields = ['user__first_name', 'user__last_name', 'user__username', 'user__date_joined']\n     list_filter = ['user__date_joined']\n     list_display = ['user', 'joined_recently']\n     readonly_fields = ['user']\n \n \n class EmailVerificationAdmin(admin.ModelAdmin):\n-    search_fields = ['new_user']\n+    search_fields = ['user__first_name', 'user__last_name', 'user__username', 'user__date_joined']\n \n \n UserAdmin.list_display += ('date_joined',)\n", "issue": "Speak to legal team about updating our T&Cs for GDPR\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n# Code for Life\n#\n# Copyright (C) 2018, Ocado Innovation Limited\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as\n# published by the Free Software Foundation, either version 3 of the\n# License, or (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU Affero General Public License for more details.\n#\n# You should have received a copy of the GNU Affero General Public License\n# along with this program.  If not, see <http://www.gnu.org/licenses/>.\n#\n# ADDITIONAL TERMS \u2013 Section 7 GNU General Public Licence\n#\n# This licence does not grant any right, title or interest in any \u201cOcado\u201d logos,\n# trade names or the trademark \u201cOcado\u201d or any other trademarks or domain names\n# owned by Ocado Innovation Limited or the Ocado group of companies or any other\n# distinctive brand features of \u201cOcado\u201d as may be secured from time to time. You\n# must not distribute any modification of this program using the trademark\n# \u201cOcado\u201d or claim any affiliation or association with Ocado or its employees.\n#\n# You are not authorised to use the name Ocado (or any of its trade names) or\n# the names of any author or contributor in advertising or for publicity purposes\n# pertaining to the distribution of this program, without the prior written\n# authorisation of Ocado.\n#\n# Any propagation, distribution or conveyance of this program must include this\n# copyright notice and these terms. You must not misrepresent the origins of this\n# program; modified versions of the program must be marked as such and not\n# identified as the original program.\nfrom django.contrib import admin\nfrom django.contrib.auth.models import User\nfrom django.contrib.auth.admin import UserAdmin\n\n\nfrom portal.models import Class, Student, Guardian, Teacher, School, UserProfile, FrontPageNews, EmailVerification\n\n\nclass ClassAdmin(admin.ModelAdmin):\n    search_fields = ['name', 'teacher__new_user__first_name', 'teacher__new_user__last_name']\n    list_filter = ['teacher']\n    readonly_fields = ['teacher']\n\n\nclass SchoolAdmin(admin.ModelAdmin):\n    search_fields = ['name', 'country', 'postcode', 'town']\n    list_filter = ['postcode', 'country']\n\n\nclass StudentAdmin(admin.ModelAdmin):\n    search_fields = ['new_user__first_name', 'new_user__last_name']\n    list_filter = ['class_field', 'class_field__teacher']\n    readonly_fields = ['user', 'new_user']\n    raw_id_fields = ['class_field', 'pending_class_request']\n\n\nclass TeacherAdmin(admin.ModelAdmin):\n    search_fields = ['new_user__first_name', 'new_user__last_name']\n    list_filter = ['school']\n    readonly_fields = ['user', 'new_user']\n    raw_id_fields = ['school', 'pending_join_request']\n\n\nclass UserProfileAdmin(admin.ModelAdmin):\n    search_fields = ['user__first_name', 'user__last_name', 'new_username', 'user__date_joined']\n    list_filter = ['user__date_joined']\n    list_display = ['user', 'joined_recently']\n    readonly_fields = ['user']\n\n\nclass EmailVerificationAdmin(admin.ModelAdmin):\n    search_fields = ['new_user']\n\n\nUserAdmin.list_display += ('date_joined',)\nUserAdmin.list_filter += ('date_joined',)\n\n\nadmin.site.register(Class, ClassAdmin)\nadmin.site.register(Student, StudentAdmin)\nadmin.site.register(Guardian)\nadmin.site.register(Teacher, TeacherAdmin)\nadmin.site.register(School, SchoolAdmin)\nadmin.site.unregister(User)\nadmin.site.register(User, UserAdmin)\nadmin.site.register(UserProfile, UserProfileAdmin)\nadmin.site.register(FrontPageNews)\nadmin.site.register(EmailVerification, EmailVerificationAdmin)\n", "path": "portal/admin.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n# Code for Life\n#\n# Copyright (C) 2018, Ocado Innovation Limited\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as\n# published by the Free Software Foundation, either version 3 of the\n# License, or (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU Affero General Public License for more details.\n#\n# You should have received a copy of the GNU Affero General Public License\n# along with this program.  If not, see <http://www.gnu.org/licenses/>.\n#\n# ADDITIONAL TERMS \u2013 Section 7 GNU General Public Licence\n#\n# This licence does not grant any right, title or interest in any \u201cOcado\u201d logos,\n# trade names or the trademark \u201cOcado\u201d or any other trademarks or domain names\n# owned by Ocado Innovation Limited or the Ocado group of companies or any other\n# distinctive brand features of \u201cOcado\u201d as may be secured from time to time. You\n# must not distribute any modification of this program using the trademark\n# \u201cOcado\u201d or claim any affiliation or association with Ocado or its employees.\n#\n# You are not authorised to use the name Ocado (or any of its trade names) or\n# the names of any author or contributor in advertising or for publicity purposes\n# pertaining to the distribution of this program, without the prior written\n# authorisation of Ocado.\n#\n# Any propagation, distribution or conveyance of this program must include this\n# copyright notice and these terms. You must not misrepresent the origins of this\n# program; modified versions of the program must be marked as such and not\n# identified as the original program.\nfrom django.contrib import admin\nfrom django.contrib.auth.models import User\nfrom django.contrib.auth.admin import UserAdmin\n\n\nfrom portal.models import Class, Student, Guardian, Teacher, School, UserProfile, FrontPageNews, EmailVerification\n\n\nclass ClassAdmin(admin.ModelAdmin):\n    search_fields = ['name', 'teacher__new_user__first_name', 'teacher__new_user__last_name']\n    list_filter = ['teacher']\n    readonly_fields = ['teacher']\n\n\nclass SchoolAdmin(admin.ModelAdmin):\n    search_fields = ['name', 'country', 'postcode', 'town']\n    list_filter = ['postcode', 'country']\n\n\nclass StudentAdmin(admin.ModelAdmin):\n    search_fields = ['new_user__first_name', 'new_user__last_name']\n    list_filter = ['class_field', 'class_field__teacher']\n    readonly_fields = ['user', 'new_user']\n    raw_id_fields = ['class_field', 'pending_class_request']\n\n\nclass TeacherAdmin(admin.ModelAdmin):\n    search_fields = ['new_user__first_name', 'new_user__last_name']\n    list_filter = ['school']\n    readonly_fields = ['user', 'new_user']\n    raw_id_fields = ['school', 'pending_join_request']\n\n\nclass UserProfileAdmin(admin.ModelAdmin):\n    search_fields = ['user__first_name', 'user__last_name', 'user__username', 'user__date_joined']\n    list_filter = ['user__date_joined']\n    list_display = ['user', 'joined_recently']\n    readonly_fields = ['user']\n\n\nclass EmailVerificationAdmin(admin.ModelAdmin):\n    search_fields = ['user__first_name', 'user__last_name', 'user__username', 'user__date_joined']\n\n\nUserAdmin.list_display += ('date_joined',)\nUserAdmin.list_filter += ('date_joined',)\n\n\nadmin.site.register(Class, ClassAdmin)\nadmin.site.register(Student, StudentAdmin)\nadmin.site.register(Guardian)\nadmin.site.register(Teacher, TeacherAdmin)\nadmin.site.register(School, SchoolAdmin)\nadmin.site.unregister(User)\nadmin.site.register(User, UserAdmin)\nadmin.site.register(UserProfile, UserProfileAdmin)\nadmin.site.register(FrontPageNews)\nadmin.site.register(EmailVerification, EmailVerificationAdmin)\n", "path": "portal/admin.py"}]}