prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Migration 0040_set_admin_is_staff.py is missing dependency on user model
  
  
  </issue>
  <code>
  [start of pulpcore/app/migrations/0040_set_admin_is_staff.py]
  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 of pulpcore/app/migrations/0040_set_admin_is_staff.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: 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),
       ]
  
verification_info: {"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"}]}