prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  use small images in user avatar in moderators list
  
  
  </issue>
  <code>
  [start of euth/users/serializers.py]
  1 from rest_framework import serializers
  2 
  3 from .models import User
  4 
  5 
  6 class UserSerializer(serializers.ModelSerializer):
  7     avatar = serializers.ImageField()
  8 
  9     class Meta:
  10         model = User
  11         fields = ('id', 'username', 'avatar', 'default_avatar')
  12         read_only_fields = ('id', 'username', 'avatar', 'default_avatar')
  13 
  14 
  15 # mails should not be exposed in API, so there is a separate one for this
  16 class UserWithMailSerializer(UserSerializer):
  17     class Meta(UserSerializer.Meta):
  18         fields = ('id', 'username', 'avatar', 'default_avatar', 'email')
  19         read_only_fields = ('id', 'username', 'avatar', 'default_avatar',
  20                             'email')
  21
  [end of euth/users/serializers.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/serializers.py b/euth/users/serializers.py
  --- a/euth/users/serializers.py
  +++ b/euth/users/serializers.py
  @@ -1,16 +1,22 @@
  +from easy_thumbnails.files import get_thumbnailer
   from rest_framework import serializers
   
   from .models import User
   
   
   class UserSerializer(serializers.ModelSerializer):
  -    avatar = serializers.ImageField()
  +    avatar = serializers.SerializerMethodField()
   
       class Meta:
           model = User
           fields = ('id', 'username', 'avatar', 'default_avatar')
           read_only_fields = ('id', 'username', 'avatar', 'default_avatar')
   
  +    def get_avatar(self, obj):
  +        if obj.avatar:
  +            image = get_thumbnailer(obj.avatar)['avatar_small']
  +            return image.url
  +
   
   # mails should not be exposed in API, so there is a separate one for this
   class UserWithMailSerializer(UserSerializer):
  
verification_info: {"golden_diff": "diff --git a/euth/users/serializers.py b/euth/users/serializers.py\n--- a/euth/users/serializers.py\n+++ b/euth/users/serializers.py\n@@ -1,16 +1,22 @@\n+from easy_thumbnails.files import get_thumbnailer\n from rest_framework import serializers\n \n from .models import User\n \n \n class UserSerializer(serializers.ModelSerializer):\n-    avatar = serializers.ImageField()\n+    avatar = serializers.SerializerMethodField()\n \n     class Meta:\n         model = User\n         fields = ('id', 'username', 'avatar', 'default_avatar')\n         read_only_fields = ('id', 'username', 'avatar', 'default_avatar')\n \n+    def get_avatar(self, obj):\n+        if obj.avatar:\n+            image = get_thumbnailer(obj.avatar)['avatar_small']\n+            return image.url\n+\n \n # mails should not be exposed in API, so there is a separate one for this\n class UserWithMailSerializer(UserSerializer):\n", "issue": "use small images in user avatar in moderators list\n\n", "before_files": [{"content": "from rest_framework import serializers\n\nfrom .models import User\n\n\nclass UserSerializer(serializers.ModelSerializer):\n    avatar = serializers.ImageField()\n\n    class Meta:\n        model = User\n        fields = ('id', 'username', 'avatar', 'default_avatar')\n        read_only_fields = ('id', 'username', 'avatar', 'default_avatar')\n\n\n# mails should not be exposed in API, so there is a separate one for this\nclass UserWithMailSerializer(UserSerializer):\n    class Meta(UserSerializer.Meta):\n        fields = ('id', 'username', 'avatar', 'default_avatar', 'email')\n        read_only_fields = ('id', 'username', 'avatar', 'default_avatar',\n                            'email')\n", "path": "euth/users/serializers.py"}]}