We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Promote people to superuser in Django admin
Replace the current `is_staff` checkbox with a `is_superuser` checkbox. This way, the project manager can give superuser access (access to Django admin interface) to people without touching the command line. 

Project managers can access the Cantus editing functionalities (within the Cantus DB website, not the Admin interface). 
Superusers can access the Django admin interface. 
If we want someone to have access to both, they need to be in the `project manager` group and have `is_superuser` as `True`.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `django/cantusdb_project/main_app/admin.py`
Content:
```
1 from django.contrib import admin
2 from main_app.models import *
3 # Register your models here.
4 admin.site.register(Chant)
5 admin.site.register(Feast)
6 admin.site.register(Genre)
7 admin.site.register(Indexer)
8 admin.site.register(Notation)
9 admin.site.register(Office)
10 admin.site.register(Provenance)
11 admin.site.register(Segment)
12 admin.site.register(Sequence)
13 admin.site.register(Source)
14
```

Path: `django/cantusdb_project/users/admin.py`
Content:
```
1 from django.contrib import admin
2 from .models import *
3 from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
4 from django.contrib.auth.forms import UserCreationForm, UserChangeForm
5 
6 # Register your models here.
7 
8 class CustomUserCreationForm(UserCreationForm):
9 
10     class Meta:
11         model = User
12         fields = (
13             'email', 'password', 'is_active', 'date_joined', 'last_login', 
14             'full_name', 'first_name', 'last_name', 'institution', 'city', 
15             'country', 'website', 'is_staff', 'groups', 'sources_user_can_edit',
16         )
17 
18 
19 class CustomUserChangeForm(UserChangeForm):
20 
21     class Meta:
22         model = User
23         fields = (
24             'email', 'password', 'is_active', 'date_joined', 'last_login', 
25             'full_name', 'first_name', 'last_name', 'institution', 'city', 
26             'country', 'website', 'is_staff', 'groups', 'sources_user_can_edit',
27         )
28 
29 
30 class UserAdmin(BaseUserAdmin):
31     form = CustomUserChangeForm
32     add_form = CustomUserCreationForm 
33     list_display = ('email', 'first_name', 'last_name', 'institution',)
34     list_filter = ('groups',)
35     fieldsets = (
36         ('Account info', {'fields': (('email', 'password'), 'is_active', ('date_joined', 'last_login'))}),
37         ('Personal info', {'fields': ('full_name', ('first_name', 'last_name'), 'institution', ('city', 'country'), 'website',)}),
38         ('Permissions', {'fields': ('is_staff', 'groups', 'sources_user_can_edit',)}),
39     )
40     add_fieldsets = (
41         ('Account info', {'fields': ('email', ('password1', 'password2'),)}),
42         ('Personal info', {'fields': ('full_name', ('first_name', 'last_name'), 'institution', ('city', 'country'), 'website',)}),
43         ('Permissions', {'fields': ('is_staff', 'groups', 'sources_user_can_edit',)}),
44     )
45     search_fields = ('email', 'first_name', 'last_name', 'institution',)
46     ordering = ('email',)
47     filter_horizontal = ('groups', 'sources_user_can_edit',)
48 
49 admin.site.register(User, UserAdmin)
50
```
--- 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/django/cantusdb_project/main_app/admin.py b/django/cantusdb_project/main_app/admin.py
--- a/django/cantusdb_project/main_app/admin.py
+++ b/django/cantusdb_project/main_app/admin.py
@@ -1,6 +1,15 @@
 from django.contrib import admin
 from main_app.models import *
+from django.contrib.auth import get_user_model
 # Register your models here.
+
+class SourcesUserCanEditInline(admin.TabularInline):
+    model = get_user_model().sources_user_can_edit.through
+
+class SourceAdmin(admin.ModelAdmin):
+    inlines = [SourcesUserCanEditInline]
+    filter_horizontal = ('century', 'notation', 'current_editors', 'inventoried_by', 'full_text_entered_by', 'melodies_entered_by', 'proofreaders', 'other_editors')
+
 admin.site.register(Chant)
 admin.site.register(Feast)
 admin.site.register(Genre)
@@ -10,4 +19,4 @@
 admin.site.register(Provenance)
 admin.site.register(Segment)
 admin.site.register(Sequence)
-admin.site.register(Source)
+admin.site.register(Source, SourceAdmin)
diff --git a/django/cantusdb_project/users/admin.py b/django/cantusdb_project/users/admin.py
--- a/django/cantusdb_project/users/admin.py
+++ b/django/cantusdb_project/users/admin.py
@@ -5,42 +5,19 @@
 
 # Register your models here.
 
-class CustomUserCreationForm(UserCreationForm):
-
-    class Meta:
-        model = User
-        fields = (
-            'email', 'password', 'is_active', 'date_joined', 'last_login', 
-            'full_name', 'first_name', 'last_name', 'institution', 'city', 
-            'country', 'website', 'is_staff', 'groups', 'sources_user_can_edit',
-        )
-
-
-class CustomUserChangeForm(UserChangeForm):
-
-    class Meta:
-        model = User
-        fields = (
-            'email', 'password', 'is_active', 'date_joined', 'last_login', 
-            'full_name', 'first_name', 'last_name', 'institution', 'city', 
-            'country', 'website', 'is_staff', 'groups', 'sources_user_can_edit',
-        )
-
-
 class UserAdmin(BaseUserAdmin):
-    form = CustomUserChangeForm
-    add_form = CustomUserCreationForm 
+    readonly_fields = ('date_joined', 'last_login',)
     list_display = ('email', 'first_name', 'last_name', 'institution',)
     list_filter = ('groups',)
     fieldsets = (
         ('Account info', {'fields': (('email', 'password'), 'is_active', ('date_joined', 'last_login'))}),
         ('Personal info', {'fields': ('full_name', ('first_name', 'last_name'), 'institution', ('city', 'country'), 'website',)}),
-        ('Permissions', {'fields': ('is_staff', 'groups', 'sources_user_can_edit',)}),
+        ('Permissions', {'fields': ('is_staff', 'is_superuser', 'groups', 'sources_user_can_edit',)}),
     )
     add_fieldsets = (
         ('Account info', {'fields': ('email', ('password1', 'password2'),)}),
         ('Personal info', {'fields': ('full_name', ('first_name', 'last_name'), 'institution', ('city', 'country'), 'website',)}),
-        ('Permissions', {'fields': ('is_staff', 'groups', 'sources_user_can_edit',)}),
+        ('Permissions', {'fields': ('is_staff', 'is_superuser', 'groups', 'sources_user_can_edit',)}),
     )
     search_fields = ('email', 'first_name', 'last_name', 'institution',)
     ordering = ('email',)

{"golden_diff": "diff --git a/django/cantusdb_project/main_app/admin.py b/django/cantusdb_project/main_app/admin.py\n--- a/django/cantusdb_project/main_app/admin.py\n+++ b/django/cantusdb_project/main_app/admin.py\n@@ -1,6 +1,15 @@\n from django.contrib import admin\n from main_app.models import *\n+from django.contrib.auth import get_user_model\n # Register your models here.\n+\n+class SourcesUserCanEditInline(admin.TabularInline):\n+    model = get_user_model().sources_user_can_edit.through\n+\n+class SourceAdmin(admin.ModelAdmin):\n+    inlines = [SourcesUserCanEditInline]\n+    filter_horizontal = ('century', 'notation', 'current_editors', 'inventoried_by', 'full_text_entered_by', 'melodies_entered_by', 'proofreaders', 'other_editors')\n+\n admin.site.register(Chant)\n admin.site.register(Feast)\n admin.site.register(Genre)\n@@ -10,4 +19,4 @@\n admin.site.register(Provenance)\n admin.site.register(Segment)\n admin.site.register(Sequence)\n-admin.site.register(Source)\n+admin.site.register(Source, SourceAdmin)\ndiff --git a/django/cantusdb_project/users/admin.py b/django/cantusdb_project/users/admin.py\n--- a/django/cantusdb_project/users/admin.py\n+++ b/django/cantusdb_project/users/admin.py\n@@ -5,42 +5,19 @@\n \n # Register your models here.\n \n-class CustomUserCreationForm(UserCreationForm):\n-\n-    class Meta:\n-        model = User\n-        fields = (\n-            'email', 'password', 'is_active', 'date_joined', 'last_login', \n-            'full_name', 'first_name', 'last_name', 'institution', 'city', \n-            'country', 'website', 'is_staff', 'groups', 'sources_user_can_edit',\n-        )\n-\n-\n-class CustomUserChangeForm(UserChangeForm):\n-\n-    class Meta:\n-        model = User\n-        fields = (\n-            'email', 'password', 'is_active', 'date_joined', 'last_login', \n-            'full_name', 'first_name', 'last_name', 'institution', 'city', \n-            'country', 'website', 'is_staff', 'groups', 'sources_user_can_edit',\n-        )\n-\n-\n class UserAdmin(BaseUserAdmin):\n-    form = CustomUserChangeForm\n-    add_form = CustomUserCreationForm \n+    readonly_fields = ('date_joined', 'last_login',)\n     list_display = ('email', 'first_name', 'last_name', 'institution',)\n     list_filter = ('groups',)\n     fieldsets = (\n         ('Account info', {'fields': (('email', 'password'), 'is_active', ('date_joined', 'last_login'))}),\n         ('Personal info', {'fields': ('full_name', ('first_name', 'last_name'), 'institution', ('city', 'country'), 'website',)}),\n-        ('Permissions', {'fields': ('is_staff', 'groups', 'sources_user_can_edit',)}),\n+        ('Permissions', {'fields': ('is_staff', 'is_superuser', 'groups', 'sources_user_can_edit',)}),\n     )\n     add_fieldsets = (\n         ('Account info', {'fields': ('email', ('password1', 'password2'),)}),\n         ('Personal info', {'fields': ('full_name', ('first_name', 'last_name'), 'institution', ('city', 'country'), 'website',)}),\n-        ('Permissions', {'fields': ('is_staff', 'groups', 'sources_user_can_edit',)}),\n+        ('Permissions', {'fields': ('is_staff', 'is_superuser', 'groups', 'sources_user_can_edit',)}),\n     )\n     search_fields = ('email', 'first_name', 'last_name', 'institution',)\n     ordering = ('email',)\n", "issue": "Promote people to superuser in Django admin\nReplace the current `is_staff` checkbox with a `is_superuser` checkbox. This way, the project manager can give superuser access (access to Django admin interface) to people without touching the command line. \r\n\r\nProject managers can access the Cantus editing functionalities (within the Cantus DB website, not the Admin interface). \r\nSuperusers can access the Django admin interface. \r\nIf we want someone to have access to both, they need to be in the `project manager` group and have `is_superuser` as `True`.\n", "before_files": [{"content": "from django.contrib import admin\nfrom main_app.models import *\n# Register your models here.\nadmin.site.register(Chant)\nadmin.site.register(Feast)\nadmin.site.register(Genre)\nadmin.site.register(Indexer)\nadmin.site.register(Notation)\nadmin.site.register(Office)\nadmin.site.register(Provenance)\nadmin.site.register(Segment)\nadmin.site.register(Sequence)\nadmin.site.register(Source)\n", "path": "django/cantusdb_project/main_app/admin.py"}, {"content": "from django.contrib import admin\nfrom .models import *\nfrom django.contrib.auth.admin import UserAdmin as BaseUserAdmin\nfrom django.contrib.auth.forms import UserCreationForm, UserChangeForm\n\n# Register your models here.\n\nclass CustomUserCreationForm(UserCreationForm):\n\n    class Meta:\n        model = User\n        fields = (\n            'email', 'password', 'is_active', 'date_joined', 'last_login', \n            'full_name', 'first_name', 'last_name', 'institution', 'city', \n            'country', 'website', 'is_staff', 'groups', 'sources_user_can_edit',\n        )\n\n\nclass CustomUserChangeForm(UserChangeForm):\n\n    class Meta:\n        model = User\n        fields = (\n            'email', 'password', 'is_active', 'date_joined', 'last_login', \n            'full_name', 'first_name', 'last_name', 'institution', 'city', \n            'country', 'website', 'is_staff', 'groups', 'sources_user_can_edit',\n        )\n\n\nclass UserAdmin(BaseUserAdmin):\n    form = CustomUserChangeForm\n    add_form = CustomUserCreationForm \n    list_display = ('email', 'first_name', 'last_name', 'institution',)\n    list_filter = ('groups',)\n    fieldsets = (\n        ('Account info', {'fields': (('email', 'password'), 'is_active', ('date_joined', 'last_login'))}),\n        ('Personal info', {'fields': ('full_name', ('first_name', 'last_name'), 'institution', ('city', 'country'), 'website',)}),\n        ('Permissions', {'fields': ('is_staff', 'groups', 'sources_user_can_edit',)}),\n    )\n    add_fieldsets = (\n        ('Account info', {'fields': ('email', ('password1', 'password2'),)}),\n        ('Personal info', {'fields': ('full_name', ('first_name', 'last_name'), 'institution', ('city', 'country'), 'website',)}),\n        ('Permissions', {'fields': ('is_staff', 'groups', 'sources_user_can_edit',)}),\n    )\n    search_fields = ('email', 'first_name', 'last_name', 'institution',)\n    ordering = ('email',)\n    filter_horizontal = ('groups', 'sources_user_can_edit',)\n\nadmin.site.register(User, UserAdmin)\n", "path": "django/cantusdb_project/users/admin.py"}], "after_files": [{"content": "from django.contrib import admin\nfrom main_app.models import *\nfrom django.contrib.auth import get_user_model\n# Register your models here.\n\nclass SourcesUserCanEditInline(admin.TabularInline):\n    model = get_user_model().sources_user_can_edit.through\n\nclass SourceAdmin(admin.ModelAdmin):\n    inlines = [SourcesUserCanEditInline]\n    filter_horizontal = ('century', 'notation', 'current_editors', 'inventoried_by', 'full_text_entered_by', 'melodies_entered_by', 'proofreaders', 'other_editors')\n\nadmin.site.register(Chant)\nadmin.site.register(Feast)\nadmin.site.register(Genre)\nadmin.site.register(Indexer)\nadmin.site.register(Notation)\nadmin.site.register(Office)\nadmin.site.register(Provenance)\nadmin.site.register(Segment)\nadmin.site.register(Sequence)\nadmin.site.register(Source, SourceAdmin)\n", "path": "django/cantusdb_project/main_app/admin.py"}, {"content": "from django.contrib import admin\nfrom .models import *\nfrom django.contrib.auth.admin import UserAdmin as BaseUserAdmin\nfrom django.contrib.auth.forms import UserCreationForm, UserChangeForm\n\n# Register your models here.\n\nclass UserAdmin(BaseUserAdmin):\n    readonly_fields = ('date_joined', 'last_login',)\n    list_display = ('email', 'first_name', 'last_name', 'institution',)\n    list_filter = ('groups',)\n    fieldsets = (\n        ('Account info', {'fields': (('email', 'password'), 'is_active', ('date_joined', 'last_login'))}),\n        ('Personal info', {'fields': ('full_name', ('first_name', 'last_name'), 'institution', ('city', 'country'), 'website',)}),\n        ('Permissions', {'fields': ('is_staff', 'is_superuser', 'groups', 'sources_user_can_edit',)}),\n    )\n    add_fieldsets = (\n        ('Account info', {'fields': ('email', ('password1', 'password2'),)}),\n        ('Personal info', {'fields': ('full_name', ('first_name', 'last_name'), 'institution', ('city', 'country'), 'website',)}),\n        ('Permissions', {'fields': ('is_staff', 'is_superuser', 'groups', 'sources_user_can_edit',)}),\n    )\n    search_fields = ('email', 'first_name', 'last_name', 'institution',)\n    ordering = ('email',)\n    filter_horizontal = ('groups', 'sources_user_can_edit',)\n\nadmin.site.register(User, UserAdmin)\n", "path": "django/cantusdb_project/users/admin.py"}]}