We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Migration 0040_set_admin_is_staff.py is missing dependency on user model


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `pulpcore/app/migrations/0040_set_admin_is_staff.py`
Content:
```
1 # Generated by Django 2.2.13 on 2020-07-01 21:29
2 
3 from django.contrib.auth import get_user_model
4 from django.db import migrations
5 
6 
7 def allow_admin_as_staff(apps, schema_editor):
8     user_model = get_user_model()
9     try:
10         admin_user = user_model.objects.get(username='admin')
11     except user_model.DoesNotExist:
12         pass
13     else:
14         admin_user.is_staff = True
15         admin_user.save()
16 
17 
18 class Migration(migrations.Migration):
19 
20     dependencies = [
21         ('core', '0039_change_download_concurrency'),
22     ]
23 
24     operations = [
25         migrations.RunPython(allow_admin_as_staff),
26     ]
27
```
--- 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/pulpcore/app/migrations/0040_set_admin_is_staff.py b/pulpcore/app/migrations/0040_set_admin_is_staff.py
--- a/pulpcore/app/migrations/0040_set_admin_is_staff.py
+++ b/pulpcore/app/migrations/0040_set_admin_is_staff.py
@@ -1,5 +1,6 @@
 # Generated by Django 2.2.13 on 2020-07-01 21:29
 
+from django.conf import settings
 from django.contrib.auth import get_user_model
 from django.db import migrations
 
@@ -19,8 +20,9 @@
 
     dependencies = [
         ('core', '0039_change_download_concurrency'),
+        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
     ]
 
     operations = [
-        migrations.RunPython(allow_admin_as_staff),
+        migrations.RunPython(allow_admin_as_staff, reverse_code=migrations.RunPython.noop, elidable=True),
     ]

{"golden_diff": "diff --git a/pulpcore/app/migrations/0040_set_admin_is_staff.py b/pulpcore/app/migrations/0040_set_admin_is_staff.py\n--- a/pulpcore/app/migrations/0040_set_admin_is_staff.py\n+++ b/pulpcore/app/migrations/0040_set_admin_is_staff.py\n@@ -1,5 +1,6 @@\n # Generated by Django 2.2.13 on 2020-07-01 21:29\n \n+from django.conf import settings\n from django.contrib.auth import get_user_model\n from django.db import migrations\n \n@@ -19,8 +20,9 @@\n \n     dependencies = [\n         ('core', '0039_change_download_concurrency'),\n+        migrations.swappable_dependency(settings.AUTH_USER_MODEL),\n     ]\n \n     operations = [\n-        migrations.RunPython(allow_admin_as_staff),\n+        migrations.RunPython(allow_admin_as_staff, reverse_code=migrations.RunPython.noop, elidable=True),\n     ]\n", "issue": "Migration 0040_set_admin_is_staff.py is missing dependency on user model\n\n", "before_files": [{"content": "# Generated by Django 2.2.13 on 2020-07-01 21:29\n\nfrom django.contrib.auth import get_user_model\nfrom django.db import migrations\n\n\ndef allow_admin_as_staff(apps, schema_editor):\n    user_model = get_user_model()\n    try:\n        admin_user = user_model.objects.get(username='admin')\n    except user_model.DoesNotExist:\n        pass\n    else:\n        admin_user.is_staff = True\n        admin_user.save()\n\n\nclass Migration(migrations.Migration):\n\n    dependencies = [\n        ('core', '0039_change_download_concurrency'),\n    ]\n\n    operations = [\n        migrations.RunPython(allow_admin_as_staff),\n    ]\n", "path": "pulpcore/app/migrations/0040_set_admin_is_staff.py"}], "after_files": [{"content": "# Generated by Django 2.2.13 on 2020-07-01 21:29\n\nfrom django.conf import settings\nfrom django.contrib.auth import get_user_model\nfrom django.db import migrations\n\n\ndef allow_admin_as_staff(apps, schema_editor):\n    user_model = get_user_model()\n    try:\n        admin_user = user_model.objects.get(username='admin')\n    except user_model.DoesNotExist:\n        pass\n    else:\n        admin_user.is_staff = True\n        admin_user.save()\n\n\nclass Migration(migrations.Migration):\n\n    dependencies = [\n        ('core', '0039_change_download_concurrency'),\n        migrations.swappable_dependency(settings.AUTH_USER_MODEL),\n    ]\n\n    operations = [\n        migrations.RunPython(allow_admin_as_staff, reverse_code=migrations.RunPython.noop, elidable=True),\n    ]\n", "path": "pulpcore/app/migrations/0040_set_admin_is_staff.py"}]}