We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Move forms from `api/forms.py` to the `accounts/forms.py`
## Idea summary

There are several account/profile forms defined in [`api/forms.py`](https://github.com/CiviWiki/OpenCiviWiki/blob/develop/project/api/forms.py). Those forms should be moved to [`accounts/forms.py`](https://github.com/CiviWiki/OpenCiviWiki/blob/develop/project/accounts/forms.py) or deleted if they are duplicate code.

**Update:** the code in `api/forms.py` is actually redundant, so may simply be deleted.

## Task

The steps to complete this task are:

- [x] [fork this repository](https://docs.github.com/en/get-started/quickstart/fork-a-repo) and clone it to your local computer
- [x] set up a local development environment as [outlined in our Contributing Guide](https://github.com/CiviWiki/OpenCiviWiki/blob/develop/CONTRIBUTING.md#development)
- [x] delete the file `api/forms.py`
- [x] commit your changes
- [x] push your code to GitHub
- [x] [open a pull request](https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request) against the `main` branch in this repository

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `project/api/forms.py`
Content:
```
1 from django import forms
2 from django.core.files.images import get_image_dimensions
3 from django.contrib.auth import get_user_model
4 from accounts.models import Profile
5 
6 
7 class UpdatePassword(forms.ModelForm):
8     """
9     Form for updating User Password
10     """
11 
12     class Meta:
13         model = get_user_model()
14         fields = ["password", "verify"]
15 
16     password = forms.CharField(
17         label="Password",
18         widget=forms.PasswordInput(
19             attrs={
20                 "class": "form-control",
21                 "placeholder": "Password",
22                 "required": "True",
23             }
24         ),
25     )
26     verify = forms.CharField(
27         label="Password Verify",
28         widget=forms.PasswordInput(
29             attrs={
30                 "class": "form-control",
31                 "placeholder": "Password Verify",
32                 "required": "True",
33             }
34         ),
35         help_text="Please retype your password.",
36     )
37 
38     def clean(self):
39         """
40         Verifies that the passwords match
41         """
42         clean_data = super(UpdatePassword, self).clean()
43         if "password" in clean_data and "verify" in clean_data:
44             if clean_data["password"] != clean_data["verify"]:
45                 raise forms.ValidationError("Passwords don't match.")
46         else:
47             raise forms.ValidationError("Both password fields need to be filled out.")
48         return clean_data
49 
50 
51 class UpdateProfileImage(forms.ModelForm):
52     """
53     Form for updating profile image
54     """
55 
56     class Meta:
57         model = Profile
58         fields = ["profile_image"]
59 
60     profile_image = forms.ImageField()
61 
62     def clean_profile_image(self):
63         """
64         This function is used to make sure that profile images follow Civiwiki standards.
65 
66         Requirements:
67             - Height cannot exceed 960px
68             - Width cannot exceed 1280px
69             - Image must be (jpg, jpeg, pjeg, png)
70             - File size cannot exceed 2MB
71         """
72         profile_image = self.cleaned_data["profile_image"]
73 
74         try:
75             w, h = get_image_dimensions(profile_image)
76 
77             # validate dimensions
78             max_height = 960
79             max_width = 1280
80             if w > max_width or h > max_height:
81                 raise forms.ValidationError(
82                     u"Please use an image that is {w} x {h} pixels or smaller.".format(
83                         w=max_width, h=max_height
84                     )
85                 )
86 
87             # validate content type
88             main, sub = profile_image.content_type.split("/")
89             if not (main == "image" and sub in ["jpg", "jpeg", "pjpeg", "png"]):
90                 raise forms.ValidationError(u"Please use a JPEG or PNG image.")
91 
92             # validate file size
93             if len(profile_image) > (2000 * 1024):
94                 raise forms.ValidationError(
95                     "Profile image file size may not exceed 2MB."
96                 )
97 
98         except AttributeError:
99             pass
100 
101         return profile_image
102
```
--- 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/project/api/forms.py b/project/api/forms.py
deleted file mode 100644
--- a/project/api/forms.py
+++ /dev/null
@@ -1,101 +0,0 @@
-from django import forms
-from django.core.files.images import get_image_dimensions
-from django.contrib.auth import get_user_model
-from accounts.models import Profile
-
-
-class UpdatePassword(forms.ModelForm):
-    """
-    Form for updating User Password
-    """
-
-    class Meta:
-        model = get_user_model()
-        fields = ["password", "verify"]
-
-    password = forms.CharField(
-        label="Password",
-        widget=forms.PasswordInput(
-            attrs={
-                "class": "form-control",
-                "placeholder": "Password",
-                "required": "True",
-            }
-        ),
-    )
-    verify = forms.CharField(
-        label="Password Verify",
-        widget=forms.PasswordInput(
-            attrs={
-                "class": "form-control",
-                "placeholder": "Password Verify",
-                "required": "True",
-            }
-        ),
-        help_text="Please retype your password.",
-    )
-
-    def clean(self):
-        """
-        Verifies that the passwords match
-        """
-        clean_data = super(UpdatePassword, self).clean()
-        if "password" in clean_data and "verify" in clean_data:
-            if clean_data["password"] != clean_data["verify"]:
-                raise forms.ValidationError("Passwords don't match.")
-        else:
-            raise forms.ValidationError("Both password fields need to be filled out.")
-        return clean_data
-
-
-class UpdateProfileImage(forms.ModelForm):
-    """
-    Form for updating profile image
-    """
-
-    class Meta:
-        model = Profile
-        fields = ["profile_image"]
-
-    profile_image = forms.ImageField()
-
-    def clean_profile_image(self):
-        """
-        This function is used to make sure that profile images follow Civiwiki standards.
-
-        Requirements:
-            - Height cannot exceed 960px
-            - Width cannot exceed 1280px
-            - Image must be (jpg, jpeg, pjeg, png)
-            - File size cannot exceed 2MB
-        """
-        profile_image = self.cleaned_data["profile_image"]
-
-        try:
-            w, h = get_image_dimensions(profile_image)
-
-            # validate dimensions
-            max_height = 960
-            max_width = 1280
-            if w > max_width or h > max_height:
-                raise forms.ValidationError(
-                    u"Please use an image that is {w} x {h} pixels or smaller.".format(
-                        w=max_width, h=max_height
-                    )
-                )
-
-            # validate content type
-            main, sub = profile_image.content_type.split("/")
-            if not (main == "image" and sub in ["jpg", "jpeg", "pjpeg", "png"]):
-                raise forms.ValidationError(u"Please use a JPEG or PNG image.")
-
-            # validate file size
-            if len(profile_image) > (2000 * 1024):
-                raise forms.ValidationError(
-                    "Profile image file size may not exceed 2MB."
-                )
-
-        except AttributeError:
-            pass
-
-        return profile_image

{"golden_diff": "diff --git a/project/api/forms.py b/project/api/forms.py\ndeleted file mode 100644\n--- a/project/api/forms.py\n+++ /dev/null\n@@ -1,101 +0,0 @@\n-from django import forms\n-from django.core.files.images import get_image_dimensions\n-from django.contrib.auth import get_user_model\n-from accounts.models import Profile\n-\n-\n-class UpdatePassword(forms.ModelForm):\n-    \"\"\"\n-    Form for updating User Password\n-    \"\"\"\n-\n-    class Meta:\n-        model = get_user_model()\n-        fields = [\"password\", \"verify\"]\n-\n-    password = forms.CharField(\n-        label=\"Password\",\n-        widget=forms.PasswordInput(\n-            attrs={\n-                \"class\": \"form-control\",\n-                \"placeholder\": \"Password\",\n-                \"required\": \"True\",\n-            }\n-        ),\n-    )\n-    verify = forms.CharField(\n-        label=\"Password Verify\",\n-        widget=forms.PasswordInput(\n-            attrs={\n-                \"class\": \"form-control\",\n-                \"placeholder\": \"Password Verify\",\n-                \"required\": \"True\",\n-            }\n-        ),\n-        help_text=\"Please retype your password.\",\n-    )\n-\n-    def clean(self):\n-        \"\"\"\n-        Verifies that the passwords match\n-        \"\"\"\n-        clean_data = super(UpdatePassword, self).clean()\n-        if \"password\" in clean_data and \"verify\" in clean_data:\n-            if clean_data[\"password\"] != clean_data[\"verify\"]:\n-                raise forms.ValidationError(\"Passwords don't match.\")\n-        else:\n-            raise forms.ValidationError(\"Both password fields need to be filled out.\")\n-        return clean_data\n-\n-\n-class UpdateProfileImage(forms.ModelForm):\n-    \"\"\"\n-    Form for updating profile image\n-    \"\"\"\n-\n-    class Meta:\n-        model = Profile\n-        fields = [\"profile_image\"]\n-\n-    profile_image = forms.ImageField()\n-\n-    def clean_profile_image(self):\n-        \"\"\"\n-        This function is used to make sure that profile images follow Civiwiki standards.\n-\n-        Requirements:\n-            - Height cannot exceed 960px\n-            - Width cannot exceed 1280px\n-            - Image must be (jpg, jpeg, pjeg, png)\n-            - File size cannot exceed 2MB\n-        \"\"\"\n-        profile_image = self.cleaned_data[\"profile_image\"]\n-\n-        try:\n-            w, h = get_image_dimensions(profile_image)\n-\n-            # validate dimensions\n-            max_height = 960\n-            max_width = 1280\n-            if w > max_width or h > max_height:\n-                raise forms.ValidationError(\n-                    u\"Please use an image that is {w} x {h} pixels or smaller.\".format(\n-                        w=max_width, h=max_height\n-                    )\n-                )\n-\n-            # validate content type\n-            main, sub = profile_image.content_type.split(\"/\")\n-            if not (main == \"image\" and sub in [\"jpg\", \"jpeg\", \"pjpeg\", \"png\"]):\n-                raise forms.ValidationError(u\"Please use a JPEG or PNG image.\")\n-\n-            # validate file size\n-            if len(profile_image) > (2000 * 1024):\n-                raise forms.ValidationError(\n-                    \"Profile image file size may not exceed 2MB.\"\n-                )\n-\n-        except AttributeError:\n-            pass\n-\n-        return profile_image\n", "issue": "Move forms from `api/forms.py` to the `accounts/forms.py`\n## Idea summary\r\n\r\nThere are several account/profile forms defined in [`api/forms.py`](https://github.com/CiviWiki/OpenCiviWiki/blob/develop/project/api/forms.py). Those forms should be moved to [`accounts/forms.py`](https://github.com/CiviWiki/OpenCiviWiki/blob/develop/project/accounts/forms.py) or deleted if they are duplicate code.\r\n\r\n**Update:** the code in `api/forms.py` is actually redundant, so may simply be deleted.\r\n\r\n## Task\r\n\r\nThe steps to complete this task are:\r\n\r\n- [x] [fork this repository](https://docs.github.com/en/get-started/quickstart/fork-a-repo) and clone it to your local computer\r\n- [x] set up a local development environment as [outlined in our Contributing Guide](https://github.com/CiviWiki/OpenCiviWiki/blob/develop/CONTRIBUTING.md#development)\r\n- [x] delete the file `api/forms.py`\r\n- [x] commit your changes\r\n- [x] push your code to GitHub\r\n- [x] [open a pull request](https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request) against the `main` branch in this repository\n", "before_files": [{"content": "from django import forms\nfrom django.core.files.images import get_image_dimensions\nfrom django.contrib.auth import get_user_model\nfrom accounts.models import Profile\n\n\nclass UpdatePassword(forms.ModelForm):\n    \"\"\"\n    Form for updating User Password\n    \"\"\"\n\n    class Meta:\n        model = get_user_model()\n        fields = [\"password\", \"verify\"]\n\n    password = forms.CharField(\n        label=\"Password\",\n        widget=forms.PasswordInput(\n            attrs={\n                \"class\": \"form-control\",\n                \"placeholder\": \"Password\",\n                \"required\": \"True\",\n            }\n        ),\n    )\n    verify = forms.CharField(\n        label=\"Password Verify\",\n        widget=forms.PasswordInput(\n            attrs={\n                \"class\": \"form-control\",\n                \"placeholder\": \"Password Verify\",\n                \"required\": \"True\",\n            }\n        ),\n        help_text=\"Please retype your password.\",\n    )\n\n    def clean(self):\n        \"\"\"\n        Verifies that the passwords match\n        \"\"\"\n        clean_data = super(UpdatePassword, self).clean()\n        if \"password\" in clean_data and \"verify\" in clean_data:\n            if clean_data[\"password\"] != clean_data[\"verify\"]:\n                raise forms.ValidationError(\"Passwords don't match.\")\n        else:\n            raise forms.ValidationError(\"Both password fields need to be filled out.\")\n        return clean_data\n\n\nclass UpdateProfileImage(forms.ModelForm):\n    \"\"\"\n    Form for updating profile image\n    \"\"\"\n\n    class Meta:\n        model = Profile\n        fields = [\"profile_image\"]\n\n    profile_image = forms.ImageField()\n\n    def clean_profile_image(self):\n        \"\"\"\n        This function is used to make sure that profile images follow Civiwiki standards.\n\n        Requirements:\n            - Height cannot exceed 960px\n            - Width cannot exceed 1280px\n            - Image must be (jpg, jpeg, pjeg, png)\n            - File size cannot exceed 2MB\n        \"\"\"\n        profile_image = self.cleaned_data[\"profile_image\"]\n\n        try:\n            w, h = get_image_dimensions(profile_image)\n\n            # validate dimensions\n            max_height = 960\n            max_width = 1280\n            if w > max_width or h > max_height:\n                raise forms.ValidationError(\n                    u\"Please use an image that is {w} x {h} pixels or smaller.\".format(\n                        w=max_width, h=max_height\n                    )\n                )\n\n            # validate content type\n            main, sub = profile_image.content_type.split(\"/\")\n            if not (main == \"image\" and sub in [\"jpg\", \"jpeg\", \"pjpeg\", \"png\"]):\n                raise forms.ValidationError(u\"Please use a JPEG or PNG image.\")\n\n            # validate file size\n            if len(profile_image) > (2000 * 1024):\n                raise forms.ValidationError(\n                    \"Profile image file size may not exceed 2MB.\"\n                )\n\n        except AttributeError:\n            pass\n\n        return profile_image\n", "path": "project/api/forms.py"}], "after_files": [{"content": null, "path": "project/api/forms.py"}]}