prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Chant-edit page doesn't load for Admin user
  The chant-edit page (e.g., http://127.0.0.1:3122/edit-volpiano/702611?pk=705019) takes forever to load for Admin user. 
  I was logged in with my Admin account (i.e., superuser). Ideally, this should give me power to access and change anything. 
  
  I also check with my project manager account and it loaded fine.
  
  </issue>
  <code>
  [start of django/cantusdb_project/users/managers.py]
  1 # https://testdriven.io/blog/django-custom-user-model/#:~:text=The%20default%20User%20model%20in,either%20subclassing%20AbstractUser%20or%20AbstractBaseUser%20.
  2 
  3 from django.contrib.auth.base_user import BaseUserManager
  4 from django.utils.translation import gettext_lazy as _
  5 
  6 
  7 class CustomUserManager(BaseUserManager):
  8     """
  9     Custom user model manager where email is the unique identifiers
  10     for authentication instead of usernames.
  11     """
  12     def create_user(self, email, password, **extra_fields):
  13         """
  14         Create and save a User with the given email and password.
  15         """
  16         if not email:
  17             raise ValueError(_('The Email must be set'))
  18         email = self.normalize_email(email)
  19         user = self.model(email=email, **extra_fields)
  20         user.set_password(password)
  21         user.save()
  22         return user
  23 
  24     def create_superuser(self, email, password, **extra_fields):
  25         """
  26         Create and save a SuperUser with the given email and password.
  27         """
  28         extra_fields.setdefault('is_staff', True)
  29         extra_fields.setdefault('is_superuser', True)
  30         extra_fields.setdefault('is_active', True)
  31 
  32         if extra_fields.get('is_staff') is not True:
  33             raise ValueError(_('Superuser must have is_staff=True.'))
  34         if extra_fields.get('is_superuser') is not True:
  35             raise ValueError(_('Superuser must have is_superuser=True.'))
  36         return self.create_user(email, password, **extra_fields)
  [end of django/cantusdb_project/users/managers.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/django/cantusdb_project/users/managers.py b/django/cantusdb_project/users/managers.py
  --- a/django/cantusdb_project/users/managers.py
  +++ b/django/cantusdb_project/users/managers.py
  @@ -2,7 +2,7 @@
   
   from django.contrib.auth.base_user import BaseUserManager
   from django.utils.translation import gettext_lazy as _
  -
  +from django.contrib.auth.models import Group
   
   class CustomUserManager(BaseUserManager):
       """
  @@ -33,4 +33,7 @@
               raise ValueError(_('Superuser must have is_staff=True.'))
           if extra_fields.get('is_superuser') is not True:
               raise ValueError(_('Superuser must have is_superuser=True.'))
  -        return self.create_user(email, password, **extra_fields)
  \ No newline at end of file
  +        user = self.create_user(email, password, **extra_fields)
  +        pm = Group.objects.get(name='project manager') 
  +        pm.user_set.add(user)
  +        return user
  \ No newline at end of file
  
verification_info: {"golden_diff": "diff --git a/django/cantusdb_project/users/managers.py b/django/cantusdb_project/users/managers.py\n--- a/django/cantusdb_project/users/managers.py\n+++ b/django/cantusdb_project/users/managers.py\n@@ -2,7 +2,7 @@\n \n from django.contrib.auth.base_user import BaseUserManager\n from django.utils.translation import gettext_lazy as _\n-\n+from django.contrib.auth.models import Group\n \n class CustomUserManager(BaseUserManager):\n     \"\"\"\n@@ -33,4 +33,7 @@\n             raise ValueError(_('Superuser must have is_staff=True.'))\n         if extra_fields.get('is_superuser') is not True:\n             raise ValueError(_('Superuser must have is_superuser=True.'))\n-        return self.create_user(email, password, **extra_fields)\n\\ No newline at end of file\n+        user = self.create_user(email, password, **extra_fields)\n+        pm = Group.objects.get(name='project manager') \n+        pm.user_set.add(user)\n+        return user\n\\ No newline at end of file\n", "issue": "Chant-edit page doesn't load for Admin user\nThe chant-edit page (e.g., http://127.0.0.1:3122/edit-volpiano/702611?pk=705019) takes forever to load for Admin user. \r\nI was logged in with my Admin account (i.e., superuser). Ideally, this should give me power to access and change anything. \r\n\r\nI also check with my project manager account and it loaded fine.\n", "before_files": [{"content": "# https://testdriven.io/blog/django-custom-user-model/#:~:text=The%20default%20User%20model%20in,either%20subclassing%20AbstractUser%20or%20AbstractBaseUser%20.\n\nfrom django.contrib.auth.base_user import BaseUserManager\nfrom django.utils.translation import gettext_lazy as _\n\n\nclass CustomUserManager(BaseUserManager):\n    \"\"\"\n    Custom user model manager where email is the unique identifiers\n    for authentication instead of usernames.\n    \"\"\"\n    def create_user(self, email, password, **extra_fields):\n        \"\"\"\n        Create and save a User with the given email and password.\n        \"\"\"\n        if not email:\n            raise ValueError(_('The Email must be set'))\n        email = self.normalize_email(email)\n        user = self.model(email=email, **extra_fields)\n        user.set_password(password)\n        user.save()\n        return user\n\n    def create_superuser(self, email, password, **extra_fields):\n        \"\"\"\n        Create and save a SuperUser with the given email and password.\n        \"\"\"\n        extra_fields.setdefault('is_staff', True)\n        extra_fields.setdefault('is_superuser', True)\n        extra_fields.setdefault('is_active', True)\n\n        if extra_fields.get('is_staff') is not True:\n            raise ValueError(_('Superuser must have is_staff=True.'))\n        if extra_fields.get('is_superuser') is not True:\n            raise ValueError(_('Superuser must have is_superuser=True.'))\n        return self.create_user(email, password, **extra_fields)", "path": "django/cantusdb_project/users/managers.py"}]}