prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Add ability to change user password from Django admin
  ## Description
  Add ability to change user password from Django admin.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `terraso_backend/apps/core/admin.py`
  Content:
  ```
  1 # Copyright © 2021-2023 Technology Matters
  2 #
  3 # This program is free software: you can redistribute it and/or modify
  4 # it under the terms of the GNU Affero General Public License as published
  5 # by the Free Software Foundation, either version 3 of the License, or
  6 # (at your option) any later version.
  7 #
  8 # This program is distributed in the hope that it will be useful,
  9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11 # GNU Affero General Public License for more details.
  12 #
  13 # You should have received a copy of the GNU Affero General Public License
  14 # along with this program. If not, see https://www.gnu.org/licenses/.
  15 
  16 from django.contrib import admin
  17 
  18 from .models import (
  19     Group,
  20     Landscape,
  21     LandscapeDevelopmentStrategy,
  22     LandscapeGroup,
  23     SharedResource,
  24     TaxonomyTerm,
  25     User,
  26     UserPreference,
  27 )
  28 
  29 
  30 @admin.register(Group)
  31 class GroupAdmin(admin.ModelAdmin):
  32     list_display = ("name", "slug", "website", "created_at")
  33 
  34     def get_queryset(self, request):
  35         qs = super().get_queryset(request)
  36         return qs.exclude(associated_landscapes__is_default_landscape_group=True)
  37 
  38 
  39 @admin.register(Landscape)
  40 class LandscapeAdmin(admin.ModelAdmin):
  41     list_display = ("name", "slug", "location", "website", "created_at")
  42     raw_id_fields = ("membership_list",)
  43 
  44 
  45 class LandscapeDefaultGroup(Group):
  46     class Meta:
  47         proxy = True
  48 
  49 
  50 @admin.register(LandscapeGroup)
  51 class LandscapeGroupAdmin(admin.ModelAdmin):
  52     list_display = ("landscape", "group")
  53 
  54 
  55 class UserPreferenceInline(admin.TabularInline):
  56     model = UserPreference
  57 
  58 
  59 @admin.register(User)
  60 class UserAdmin(admin.ModelAdmin):
  61     list_display = ("email", "first_name", "last_name", "created_at", "is_staff")
  62     inlines = [UserPreferenceInline]
  63 
  64 
  65 @admin.register(TaxonomyTerm)
  66 class TaxonomyTermAdmin(admin.ModelAdmin):
  67     list_display = ("value_original", "type", "value_en", "value_es")
  68 
  69 
  70 @admin.register(LandscapeDevelopmentStrategy)
  71 class LandscapeDevelopmentStrategyAdmin(admin.ModelAdmin):
  72     list_display = ("id", "landscape")
  73 
  74 
  75 @admin.register(SharedResource)
  76 class SharedResourceAdmin(admin.ModelAdmin):
  77     list_display = ("id", "share_uuid", "share_access")
  78
  ```
  --- 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()
  
  ```
  
golden_diff: diff --git a/terraso_backend/apps/core/admin.py b/terraso_backend/apps/core/admin.py
  --- a/terraso_backend/apps/core/admin.py
  +++ b/terraso_backend/apps/core/admin.py
  @@ -14,6 +14,7 @@
   # along with this program. If not, see https://www.gnu.org/licenses/.
   
   from django.contrib import admin
  +from django.contrib.auth.admin import UserAdmin as DjangoUserAdmin
   
   from .models import (
       Group,
  @@ -57,9 +58,28 @@
   
   
   @admin.register(User)
  -class UserAdmin(admin.ModelAdmin):
  +class UserAdmin(DjangoUserAdmin):
  +    ordering = ("email",)
       list_display = ("email", "first_name", "last_name", "created_at", "is_staff")
  +    search_fields = ("email", "first_name", "last_name")
       inlines = [UserPreferenceInline]
  +    fieldsets = (
  +        (None, {"fields": ("email", "password")}),
  +        ("Personal info", {"fields": ("first_name", "last_name")}),
  +        (
  +            "Permissions",
  +            {
  +                "fields": (
  +                    "is_active",
  +                    "is_staff",
  +                    "is_superuser",
  +                    "groups",
  +                    "user_permissions",
  +                ),
  +            },
  +        ),
  +        ("Important dates", {"fields": ("last_login", "date_joined")}),
  +    )
   
   
   @admin.register(TaxonomyTerm)
  
verification_info: {"golden_diff": "diff --git a/terraso_backend/apps/core/admin.py b/terraso_backend/apps/core/admin.py\n--- a/terraso_backend/apps/core/admin.py\n+++ b/terraso_backend/apps/core/admin.py\n@@ -14,6 +14,7 @@\n # along with this program. If not, see https://www.gnu.org/licenses/.\n \n from django.contrib import admin\n+from django.contrib.auth.admin import UserAdmin as DjangoUserAdmin\n \n from .models import (\n     Group,\n@@ -57,9 +58,28 @@\n \n \n @admin.register(User)\n-class UserAdmin(admin.ModelAdmin):\n+class UserAdmin(DjangoUserAdmin):\n+    ordering = (\"email\",)\n     list_display = (\"email\", \"first_name\", \"last_name\", \"created_at\", \"is_staff\")\n+    search_fields = (\"email\", \"first_name\", \"last_name\")\n     inlines = [UserPreferenceInline]\n+    fieldsets = (\n+        (None, {\"fields\": (\"email\", \"password\")}),\n+        (\"Personal info\", {\"fields\": (\"first_name\", \"last_name\")}),\n+        (\n+            \"Permissions\",\n+            {\n+                \"fields\": (\n+                    \"is_active\",\n+                    \"is_staff\",\n+                    \"is_superuser\",\n+                    \"groups\",\n+                    \"user_permissions\",\n+                ),\n+            },\n+        ),\n+        (\"Important dates\", {\"fields\": (\"last_login\", \"date_joined\")}),\n+    )\n \n \n @admin.register(TaxonomyTerm)\n", "issue": "Add ability to change user password from Django admin\n## Description\r\nAdd ability to change user password from Django admin.\n", "before_files": [{"content": "# Copyright \u00a9 2021-2023 Technology Matters\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as published\n# by the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n#\n# You should have received a copy of the GNU Affero General Public License\n# along with this program. If not, see https://www.gnu.org/licenses/.\n\nfrom django.contrib import admin\n\nfrom .models import (\n    Group,\n    Landscape,\n    LandscapeDevelopmentStrategy,\n    LandscapeGroup,\n    SharedResource,\n    TaxonomyTerm,\n    User,\n    UserPreference,\n)\n\n\n@admin.register(Group)\nclass GroupAdmin(admin.ModelAdmin):\n    list_display = (\"name\", \"slug\", \"website\", \"created_at\")\n\n    def get_queryset(self, request):\n        qs = super().get_queryset(request)\n        return qs.exclude(associated_landscapes__is_default_landscape_group=True)\n\n\n@admin.register(Landscape)\nclass LandscapeAdmin(admin.ModelAdmin):\n    list_display = (\"name\", \"slug\", \"location\", \"website\", \"created_at\")\n    raw_id_fields = (\"membership_list\",)\n\n\nclass LandscapeDefaultGroup(Group):\n    class Meta:\n        proxy = True\n\n\n@admin.register(LandscapeGroup)\nclass LandscapeGroupAdmin(admin.ModelAdmin):\n    list_display = (\"landscape\", \"group\")\n\n\nclass UserPreferenceInline(admin.TabularInline):\n    model = UserPreference\n\n\n@admin.register(User)\nclass UserAdmin(admin.ModelAdmin):\n    list_display = (\"email\", \"first_name\", \"last_name\", \"created_at\", \"is_staff\")\n    inlines = [UserPreferenceInline]\n\n\n@admin.register(TaxonomyTerm)\nclass TaxonomyTermAdmin(admin.ModelAdmin):\n    list_display = (\"value_original\", \"type\", \"value_en\", \"value_es\")\n\n\n@admin.register(LandscapeDevelopmentStrategy)\nclass LandscapeDevelopmentStrategyAdmin(admin.ModelAdmin):\n    list_display = (\"id\", \"landscape\")\n\n\n@admin.register(SharedResource)\nclass SharedResourceAdmin(admin.ModelAdmin):\n    list_display = (\"id\", \"share_uuid\", \"share_access\")\n", "path": "terraso_backend/apps/core/admin.py"}], "after_files": [{"content": "# Copyright \u00a9 2021-2023 Technology Matters\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as published\n# by the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n#\n# You should have received a copy of the GNU Affero General Public License\n# along with this program. If not, see https://www.gnu.org/licenses/.\n\nfrom django.contrib import admin\nfrom django.contrib.auth.admin import UserAdmin as DjangoUserAdmin\n\nfrom .models import (\n    Group,\n    Landscape,\n    LandscapeDevelopmentStrategy,\n    LandscapeGroup,\n    SharedResource,\n    TaxonomyTerm,\n    User,\n    UserPreference,\n)\n\n\n@admin.register(Group)\nclass GroupAdmin(admin.ModelAdmin):\n    list_display = (\"name\", \"slug\", \"website\", \"created_at\")\n\n    def get_queryset(self, request):\n        qs = super().get_queryset(request)\n        return qs.exclude(associated_landscapes__is_default_landscape_group=True)\n\n\n@admin.register(Landscape)\nclass LandscapeAdmin(admin.ModelAdmin):\n    list_display = (\"name\", \"slug\", \"location\", \"website\", \"created_at\")\n    raw_id_fields = (\"membership_list\",)\n\n\nclass LandscapeDefaultGroup(Group):\n    class Meta:\n        proxy = True\n\n\n@admin.register(LandscapeGroup)\nclass LandscapeGroupAdmin(admin.ModelAdmin):\n    list_display = (\"landscape\", \"group\")\n\n\nclass UserPreferenceInline(admin.TabularInline):\n    model = UserPreference\n\n\n@admin.register(User)\nclass UserAdmin(DjangoUserAdmin):\n    ordering = (\"email\",)\n    list_display = (\"email\", \"first_name\", \"last_name\", \"created_at\", \"is_staff\")\n    search_fields = (\"email\", \"first_name\", \"last_name\")\n    inlines = [UserPreferenceInline]\n    fieldsets = (\n        (None, {\"fields\": (\"email\", \"password\")}),\n        (\"Personal info\", {\"fields\": (\"first_name\", \"last_name\")}),\n        (\n            \"Permissions\",\n            {\n                \"fields\": (\n                    \"is_active\",\n                    \"is_staff\",\n                    \"is_superuser\",\n                    \"groups\",\n                    \"user_permissions\",\n                ),\n            },\n        ),\n        (\"Important dates\", {\"fields\": (\"last_login\", \"date_joined\")}),\n    )\n\n\n@admin.register(TaxonomyTerm)\nclass TaxonomyTermAdmin(admin.ModelAdmin):\n    list_display = (\"value_original\", \"type\", \"value_en\", \"value_es\")\n\n\n@admin.register(LandscapeDevelopmentStrategy)\nclass LandscapeDevelopmentStrategyAdmin(admin.ModelAdmin):\n    list_display = (\"id\", \"landscape\")\n\n\n@admin.register(SharedResource)\nclass SharedResourceAdmin(admin.ModelAdmin):\n    list_display = (\"id\", \"share_uuid\", \"share_access\")\n", "path": "terraso_backend/apps/core/admin.py"}]}