prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  cannot delete user in django admin if user has not uploaded avatar 
  
  
  </issue>
  <code>
  [start of euth/users/signals.py]
  1 from django.db.models import signals
  2 from django.dispatch import receiver
  3 
  4 from adhocracy4.images import services
  5 
  6 from . import models
  7 
  8 
  9 @receiver(signals.post_init, sender=models.User)
  10 def backup_image_path(sender, instance, **kwargs):
  11     instance._current_image_file = instance.avatar
  12 
  13 
  14 @receiver(signals.post_save, sender=models.User)
  15 def delete_old_image(sender, instance, **kwargs):
  16     if hasattr(instance, '_current_image_file'):
  17         if instance._current_image_file != instance.avatar:
  18             services.delete_images([instance._current_image_file])
  19 
  20 
  21 @receiver(signals.post_delete, sender=models.User)
  22 def delete_images_for_User(sender, instance, **kwargs):
  23     services.delete_images([instance.avatar])
  24
  [end of euth/users/signals.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/euth/users/signals.py b/euth/users/signals.py
  --- a/euth/users/signals.py
  +++ b/euth/users/signals.py
  @@ -20,4 +20,4 @@
   
   @receiver(signals.post_delete, sender=models.User)
   def delete_images_for_User(sender, instance, **kwargs):
  -    services.delete_images([instance.avatar])
  +    services.delete_images([instance._avatar])
  
verification_info: {"golden_diff": "diff --git a/euth/users/signals.py b/euth/users/signals.py\n--- a/euth/users/signals.py\n+++ b/euth/users/signals.py\n@@ -20,4 +20,4 @@\n \n @receiver(signals.post_delete, sender=models.User)\n def delete_images_for_User(sender, instance, **kwargs):\n-    services.delete_images([instance.avatar])\n+    services.delete_images([instance._avatar])\n", "issue": "cannot delete user in django admin if user has not uploaded avatar \n\n", "before_files": [{"content": "from django.db.models import signals\nfrom django.dispatch import receiver\n\nfrom adhocracy4.images import services\n\nfrom . import models\n\n\n@receiver(signals.post_init, sender=models.User)\ndef backup_image_path(sender, instance, **kwargs):\n    instance._current_image_file = instance.avatar\n\n\n@receiver(signals.post_save, sender=models.User)\ndef delete_old_image(sender, instance, **kwargs):\n    if hasattr(instance, '_current_image_file'):\n        if instance._current_image_file != instance.avatar:\n            services.delete_images([instance._current_image_file])\n\n\n@receiver(signals.post_delete, sender=models.User)\ndef delete_images_for_User(sender, instance, **kwargs):\n    services.delete_images([instance.avatar])\n", "path": "euth/users/signals.py"}]}