We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
I can't add members in the Django admin page.
I can't add members in the Django admin page.

steps
- Add a member in the admin page (click a SAVE button).
  - <img width="1273" alt="スクリーンショット 2022-01-27 9 52 17" src="https://user-images.githubusercontent.com/20487308/151271702-bf60ae7e-f131-45fe-8314-e7726e90f90c.png">
- However, I get a 500 error.
  - <img width="1085" alt="スクリーンショット 2022-01-27 9 53 08" src="https://user-images.githubusercontent.com/20487308/151271872-c3fa75e8-c491-4aff-b88e-c9d970406ede.png">
- The endpoints of the POST request are different between admin page and member page.
  - `POST /admin/members/member/add/`
  - `POST /v1/projects/1/members`

Environment
---------
doccano v1.5.5


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `backend/members/models.py`
Content:
```
1 from django.conf import settings
2 from django.contrib.auth.models import User
3 from django.core.exceptions import ValidationError
4 from django.db import models
5 
6 from django.db.models import Manager
7 
8 from api.models import Project
9 from roles.models import Role
10 
11 
12 class MemberManager(Manager):
13 
14     def can_update(self, project: int, member_id: int, new_role: str) -> bool:
15         """The project needs at least 1 admin.
16 
17         Args:
18             project: The project id.
19             member_id: The member id.
20             new_role: The new role name.
21 
22         Returns:
23             Whether the mapping can be updated or not.
24         """
25         queryset = self.filter(
26             project=project, role__name=settings.ROLE_PROJECT_ADMIN
27         )
28         if queryset.count() > 1:
29             return True
30         else:
31             admin = queryset.first()
32             # we can change the role except for the only admin.
33             return admin.id != member_id or new_role == settings.ROLE_PROJECT_ADMIN
34 
35     def has_role(self, project_id: int, user: User, role_name: str):
36         return self.filter(project=project_id, user=user, role__name=role_name).exists()
37 
38 
39 class Member(models.Model):
40     user = models.ForeignKey(
41         to=User,
42         on_delete=models.CASCADE,
43         related_name='role_mappings'
44     )
45     project = models.ForeignKey(
46         to=Project,
47         on_delete=models.CASCADE,
48         related_name='role_mappings'
49     )
50     role = models.ForeignKey(
51         to=Role,
52         on_delete=models.CASCADE
53     )
54     created_at = models.DateTimeField(auto_now_add=True)
55     updated_at = models.DateTimeField(auto_now=True)
56     objects = MemberManager()
57 
58     def clean(self):
59         members = self.objects.exclude(id=self.id)
60         if members.filter(user=self.user, project=self.project).exists():
61             message = 'This user is already assigned to a role in this project.'
62             raise ValidationError(message)
63 
64     @property
65     def username(self):
66         return self.user.username
67 
68     class Meta:
69         unique_together = ('user', 'project')
70
```
--- 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()

```

diff --git a/backend/members/models.py b/backend/members/models.py
--- a/backend/members/models.py
+++ b/backend/members/models.py
@@ -56,7 +56,7 @@
     objects = MemberManager()
 
     def clean(self):
-        members = self.objects.exclude(id=self.id)
+        members = self.__class__.objects.exclude(id=self.id)
         if members.filter(user=self.user, project=self.project).exists():
             message = 'This user is already assigned to a role in this project.'
             raise ValidationError(message)

{"golden_diff": "diff --git a/backend/members/models.py b/backend/members/models.py\n--- a/backend/members/models.py\n+++ b/backend/members/models.py\n@@ -56,7 +56,7 @@\n     objects = MemberManager()\n \n     def clean(self):\n-        members = self.objects.exclude(id=self.id)\n+        members = self.__class__.objects.exclude(id=self.id)\n         if members.filter(user=self.user, project=self.project).exists():\n             message = 'This user is already assigned to a role in this project.'\n             raise ValidationError(message)\n", "issue": "I can't add members in the Django admin page.\nI can't add members in the Django admin page.\r\n\r\nsteps\r\n- Add a member in the admin page (click a SAVE button).\r\n  - <img width=\"1273\" alt=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2022-01-27 9 52 17\" src=\"https://user-images.githubusercontent.com/20487308/151271702-bf60ae7e-f131-45fe-8314-e7726e90f90c.png\">\r\n- However, I get a 500 error.\r\n  - <img width=\"1085\" alt=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2022-01-27 9 53 08\" src=\"https://user-images.githubusercontent.com/20487308/151271872-c3fa75e8-c491-4aff-b88e-c9d970406ede.png\">\r\n- The endpoints of the POST request are different between admin page and member page.\r\n  - `POST /admin/members/member/add/`\r\n  - `POST /v1/projects/1/members`\r\n\r\nEnvironment\r\n---------\r\ndoccano v1.5.5\r\n\n", "before_files": [{"content": "from django.conf import settings\nfrom django.contrib.auth.models import User\nfrom django.core.exceptions import ValidationError\nfrom django.db import models\n\nfrom django.db.models import Manager\n\nfrom api.models import Project\nfrom roles.models import Role\n\n\nclass MemberManager(Manager):\n\n    def can_update(self, project: int, member_id: int, new_role: str) -> bool:\n        \"\"\"The project needs at least 1 admin.\n\n        Args:\n            project: The project id.\n            member_id: The member id.\n            new_role: The new role name.\n\n        Returns:\n            Whether the mapping can be updated or not.\n        \"\"\"\n        queryset = self.filter(\n            project=project, role__name=settings.ROLE_PROJECT_ADMIN\n        )\n        if queryset.count() > 1:\n            return True\n        else:\n            admin = queryset.first()\n            # we can change the role except for the only admin.\n            return admin.id != member_id or new_role == settings.ROLE_PROJECT_ADMIN\n\n    def has_role(self, project_id: int, user: User, role_name: str):\n        return self.filter(project=project_id, user=user, role__name=role_name).exists()\n\n\nclass Member(models.Model):\n    user = models.ForeignKey(\n        to=User,\n        on_delete=models.CASCADE,\n        related_name='role_mappings'\n    )\n    project = models.ForeignKey(\n        to=Project,\n        on_delete=models.CASCADE,\n        related_name='role_mappings'\n    )\n    role = models.ForeignKey(\n        to=Role,\n        on_delete=models.CASCADE\n    )\n    created_at = models.DateTimeField(auto_now_add=True)\n    updated_at = models.DateTimeField(auto_now=True)\n    objects = MemberManager()\n\n    def clean(self):\n        members = self.objects.exclude(id=self.id)\n        if members.filter(user=self.user, project=self.project).exists():\n            message = 'This user is already assigned to a role in this project.'\n            raise ValidationError(message)\n\n    @property\n    def username(self):\n        return self.user.username\n\n    class Meta:\n        unique_together = ('user', 'project')\n", "path": "backend/members/models.py"}], "after_files": [{"content": "from django.conf import settings\nfrom django.contrib.auth.models import User\nfrom django.core.exceptions import ValidationError\nfrom django.db import models\n\nfrom django.db.models import Manager\n\nfrom api.models import Project\nfrom roles.models import Role\n\n\nclass MemberManager(Manager):\n\n    def can_update(self, project: int, member_id: int, new_role: str) -> bool:\n        \"\"\"The project needs at least 1 admin.\n\n        Args:\n            project: The project id.\n            member_id: The member id.\n            new_role: The new role name.\n\n        Returns:\n            Whether the mapping can be updated or not.\n        \"\"\"\n        queryset = self.filter(\n            project=project, role__name=settings.ROLE_PROJECT_ADMIN\n        )\n        if queryset.count() > 1:\n            return True\n        else:\n            admin = queryset.first()\n            # we can change the role except for the only admin.\n            return admin.id != member_id or new_role == settings.ROLE_PROJECT_ADMIN\n\n    def has_role(self, project_id: int, user: User, role_name: str):\n        return self.filter(project=project_id, user=user, role__name=role_name).exists()\n\n\nclass Member(models.Model):\n    user = models.ForeignKey(\n        to=User,\n        on_delete=models.CASCADE,\n        related_name='role_mappings'\n    )\n    project = models.ForeignKey(\n        to=Project,\n        on_delete=models.CASCADE,\n        related_name='role_mappings'\n    )\n    role = models.ForeignKey(\n        to=Role,\n        on_delete=models.CASCADE\n    )\n    created_at = models.DateTimeField(auto_now_add=True)\n    updated_at = models.DateTimeField(auto_now=True)\n    objects = MemberManager()\n\n    def clean(self):\n        members = self.__class__.objects.exclude(id=self.id)\n        if members.filter(user=self.user, project=self.project).exists():\n            message = 'This user is already assigned to a role in this project.'\n            raise ValidationError(message)\n\n    @property\n    def username(self):\n        return self.user.username\n\n    class Meta:\n        unique_together = ('user', 'project')\n", "path": "backend/members/models.py"}]}