We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Pages: Separate page and translation attributes in page form
At the moment, it is not clear which attributes of the page form refer to the `Page` object and which only handle `PageTranslation` objects (from a user's point of view). Probably, we should separate these two sections from each other.

This is part of #98.

--- 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/cms/models/region.py`
Content:
```
1 """
2 Database model representing an autonomous authority
3 """
4 from django.contrib.postgres.fields import ArrayField
5 from django.db import models
6 from django.http import Http404
7 from django.utils import timezone
8 from django.utils.translation import ugettext_lazy as _
9 
10 
11 class Region(models.Model):
12     """
13     Class to generate region database objects
14     """
15     ACTIVE = 'acti'
16     HIDDEN = 'hidd'
17     ARCHIVED = 'arch'
18 
19     STATUS = (
20         (ACTIVE, _('Active')),
21         (HIDDEN, _('Hidden')),
22         (ARCHIVED, _('Archived')),
23     )
24 
25     name = models.CharField(max_length=200)
26     slug = models.SlugField(max_length=200, unique=True, blank=True)
27     status = models.CharField(max_length=4, choices=STATUS)
28 
29     events_enabled = models.BooleanField(default=True)
30     push_notifications_enabled = models.BooleanField(default=True)
31     push_notification_channels = ArrayField(models.CharField(max_length=60), blank=True)
32 
33     latitude = models.FloatField(null=True)
34     longitude = models.FloatField(null=True)
35     postal_code = models.CharField(max_length=10)
36 
37     admin_mail = models.EmailField()
38 
39     created_date = models.DateTimeField(default=timezone.now)
40     last_updated = models.DateTimeField(auto_now=True)
41 
42     statistics_enabled = models.BooleanField(default=False)
43     matomo_url = models.CharField(max_length=150, blank=True, default='')
44     matomo_token = models.CharField(max_length=150, blank=True, default='')
45     matomo_ssl_verify = models.BooleanField(default=True)
46 
47     @property
48     def languages(self):
49         language_tree_nodes = self.language_tree_nodes.select_related('language').all()
50         return [language_tree_node.language for language_tree_node in language_tree_nodes]
51 
52     @property
53     def default_language(self):
54         tree_root = self.language_tree_nodes.filter(level=0).first()
55         return tree_root.language if tree_root else None
56 
57     @classmethod
58     def get_current_region(cls, request):
59         if not hasattr(request, 'resolver_match'):
60             return None
61         region_slug = request.resolver_match.kwargs.get('region_slug')
62         if not region_slug:
63             return None
64         region = cls.objects.filter(slug=region_slug)
65         if not region.exists():
66             raise Http404
67         return region.first()
68 
69     def __str__(self):
70         """Function that provides a string representation of this object
71 
72         Returns: String
73         """
74         return self.name
75 
76     class Meta:
77         default_permissions = ()
78         permissions = (
79             ('manage_regions', 'Can manage regions'),
80         )
81
```
--- 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/cms/models/region.py b/backend/cms/models/region.py
--- a/backend/cms/models/region.py
+++ b/backend/cms/models/region.py
@@ -56,7 +56,8 @@
 
     @classmethod
     def get_current_region(cls, request):
-        if not hasattr(request, 'resolver_match'):
+        # if rendered url is edit_region, the region slug originates from the region form.
+        if not hasattr(request, 'resolver_match') or request.resolver_match.url_name == 'edit_region':
             return None
         region_slug = request.resolver_match.kwargs.get('region_slug')
         if not region_slug:

{"golden_diff": "diff --git a/backend/cms/models/region.py b/backend/cms/models/region.py\n--- a/backend/cms/models/region.py\n+++ b/backend/cms/models/region.py\n@@ -56,7 +56,8 @@\n \n     @classmethod\n     def get_current_region(cls, request):\n-        if not hasattr(request, 'resolver_match'):\n+        # if rendered url is edit_region, the region slug originates from the region form.\n+        if not hasattr(request, 'resolver_match') or request.resolver_match.url_name == 'edit_region':\n             return None\n         region_slug = request.resolver_match.kwargs.get('region_slug')\n         if not region_slug:\n", "issue": "Pages: Separate page and translation attributes in page form\nAt the moment, it is not clear which attributes of the page form refer to the `Page` object and which only handle `PageTranslation` objects (from a user's point of view). Probably, we should separate these two sections from each other.\r\n\r\nThis is part of #98.\n", "before_files": [{"content": "\"\"\"\nDatabase model representing an autonomous authority\n\"\"\"\nfrom django.contrib.postgres.fields import ArrayField\nfrom django.db import models\nfrom django.http import Http404\nfrom django.utils import timezone\nfrom django.utils.translation import ugettext_lazy as _\n\n\nclass Region(models.Model):\n    \"\"\"\n    Class to generate region database objects\n    \"\"\"\n    ACTIVE = 'acti'\n    HIDDEN = 'hidd'\n    ARCHIVED = 'arch'\n\n    STATUS = (\n        (ACTIVE, _('Active')),\n        (HIDDEN, _('Hidden')),\n        (ARCHIVED, _('Archived')),\n    )\n\n    name = models.CharField(max_length=200)\n    slug = models.SlugField(max_length=200, unique=True, blank=True)\n    status = models.CharField(max_length=4, choices=STATUS)\n\n    events_enabled = models.BooleanField(default=True)\n    push_notifications_enabled = models.BooleanField(default=True)\n    push_notification_channels = ArrayField(models.CharField(max_length=60), blank=True)\n\n    latitude = models.FloatField(null=True)\n    longitude = models.FloatField(null=True)\n    postal_code = models.CharField(max_length=10)\n\n    admin_mail = models.EmailField()\n\n    created_date = models.DateTimeField(default=timezone.now)\n    last_updated = models.DateTimeField(auto_now=True)\n\n    statistics_enabled = models.BooleanField(default=False)\n    matomo_url = models.CharField(max_length=150, blank=True, default='')\n    matomo_token = models.CharField(max_length=150, blank=True, default='')\n    matomo_ssl_verify = models.BooleanField(default=True)\n\n    @property\n    def languages(self):\n        language_tree_nodes = self.language_tree_nodes.select_related('language').all()\n        return [language_tree_node.language for language_tree_node in language_tree_nodes]\n\n    @property\n    def default_language(self):\n        tree_root = self.language_tree_nodes.filter(level=0).first()\n        return tree_root.language if tree_root else None\n\n    @classmethod\n    def get_current_region(cls, request):\n        if not hasattr(request, 'resolver_match'):\n            return None\n        region_slug = request.resolver_match.kwargs.get('region_slug')\n        if not region_slug:\n            return None\n        region = cls.objects.filter(slug=region_slug)\n        if not region.exists():\n            raise Http404\n        return region.first()\n\n    def __str__(self):\n        \"\"\"Function that provides a string representation of this object\n\n        Returns: String\n        \"\"\"\n        return self.name\n\n    class Meta:\n        default_permissions = ()\n        permissions = (\n            ('manage_regions', 'Can manage regions'),\n        )\n", "path": "backend/cms/models/region.py"}], "after_files": [{"content": "\"\"\"\nDatabase model representing an autonomous authority\n\"\"\"\nfrom django.contrib.postgres.fields import ArrayField\nfrom django.db import models\nfrom django.http import Http404\nfrom django.utils import timezone\nfrom django.utils.translation import ugettext_lazy as _\n\n\nclass Region(models.Model):\n    \"\"\"\n    Class to generate region database objects\n    \"\"\"\n    ACTIVE = 'acti'\n    HIDDEN = 'hidd'\n    ARCHIVED = 'arch'\n\n    STATUS = (\n        (ACTIVE, _('Active')),\n        (HIDDEN, _('Hidden')),\n        (ARCHIVED, _('Archived')),\n    )\n\n    name = models.CharField(max_length=200)\n    slug = models.SlugField(max_length=200, unique=True, blank=True)\n    status = models.CharField(max_length=4, choices=STATUS)\n\n    events_enabled = models.BooleanField(default=True)\n    push_notifications_enabled = models.BooleanField(default=True)\n    push_notification_channels = ArrayField(models.CharField(max_length=60), blank=True)\n\n    latitude = models.FloatField(null=True)\n    longitude = models.FloatField(null=True)\n    postal_code = models.CharField(max_length=10)\n\n    admin_mail = models.EmailField()\n\n    created_date = models.DateTimeField(default=timezone.now)\n    last_updated = models.DateTimeField(auto_now=True)\n\n    statistics_enabled = models.BooleanField(default=False)\n    matomo_url = models.CharField(max_length=150, blank=True, default='')\n    matomo_token = models.CharField(max_length=150, blank=True, default='')\n    matomo_ssl_verify = models.BooleanField(default=True)\n\n    @property\n    def languages(self):\n        language_tree_nodes = self.language_tree_nodes.select_related('language').all()\n        return [language_tree_node.language for language_tree_node in language_tree_nodes]\n\n    @property\n    def default_language(self):\n        tree_root = self.language_tree_nodes.filter(level=0).first()\n        return tree_root.language if tree_root else None\n\n    @classmethod\n    def get_current_region(cls, request):\n        # if rendered url is edit_region, the region slug originates from the region form.\n        if not hasattr(request, 'resolver_match') or request.resolver_match.url_name == 'edit_region':\n            return None\n        region_slug = request.resolver_match.kwargs.get('region_slug')\n        if not region_slug:\n            return None\n        region = cls.objects.filter(slug=region_slug)\n        if not region.exists():\n            raise Http404\n        return region.first()\n\n    def __str__(self):\n        \"\"\"Function that provides a string representation of this object\n\n        Returns: String\n        \"\"\"\n        return self.name\n\n    class Meta:\n        default_permissions = ()\n        permissions = (\n            ('manage_regions', 'Can manage regions'),\n        )\n", "path": "backend/cms/models/region.py"}]}