prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Remove CustomMultipleChoicePreference
  As of https://github.com/agateblue/django-dynamic-preferences/pull/235 we can drop our own fix of the MultiplChoicePreference class (as soon as this is part of a release)
  Remove CustomMultipleChoicePreference
  As of https://github.com/agateblue/django-dynamic-preferences/pull/235 we can drop our own fix of the MultiplChoicePreference class (as soon as this is part of a release)
  
  </issue>
  <code>
  [start of ephios/extra/preferences.py]
  1 import json
  2 
  3 from django import forms
  4 from dynamic_preferences.types import (
  5     BasePreferenceType,
  6     BaseSerializer,
  7     ModelMultipleChoicePreference,
  8 )
  9 
  10 from ephios.extra.json import CustomJSONDecoder, CustomJSONEncoder
  11 
  12 
  13 class CustomModelMultipleChoicePreference(ModelMultipleChoicePreference):
  14     def _setup_signals(self):
  15         pass
  16 
  17 
  18 class JSONSerializer(BaseSerializer):
  19     @classmethod
  20     def clean_to_db_value(cls, value):
  21         return json.dumps(value, cls=CustomJSONEncoder, ensure_ascii=False)
  22 
  23     @classmethod
  24     def to_python(cls, value, **kwargs):
  25         return json.loads(value, cls=CustomJSONDecoder)
  26 
  27 
  28 class JSONPreference(BasePreferenceType):
  29     serializer = JSONSerializer
  30     field_class = forms.CharField
  31     widget = forms.Textarea
  32
  [end of ephios/extra/preferences.py]
  [start of ephios/core/dynamic_preferences_registry.py]
  1 from django.contrib.auth.models import Group
  2 from django.utils.safestring import mark_safe
  3 from django.utils.translation import gettext_lazy as _
  4 from django_select2.forms import Select2MultipleWidget
  5 from dynamic_preferences.preferences import Section
  6 from dynamic_preferences.registries import (
  7     PerInstancePreferenceRegistry,
  8     global_preferences_registry,
  9 )
  10 from dynamic_preferences.types import MultipleChoicePreference, StringPreference
  11 from dynamic_preferences.users.registries import user_preferences_registry
  12 
  13 import ephios
  14 from ephios.core import plugins
  15 from ephios.core.models import QualificationCategory, UserProfile
  16 from ephios.core.services.notifications.backends import CORE_NOTIFICATION_BACKENDS
  17 from ephios.core.services.notifications.types import CORE_NOTIFICATION_TYPES
  18 from ephios.extra.preferences import CustomModelMultipleChoicePreference, JSONPreference
  19 
  20 
  21 class EventTypeRegistry(PerInstancePreferenceRegistry):
  22     pass
  23 
  24 
  25 event_type_preference_registry = EventTypeRegistry()
  26 
  27 notifications_user_section = Section("notifications")
  28 responsible_notifications_user_section = Section("responsible_notifications")
  29 general_global_section = Section("general")
  30 
  31 
  32 @global_preferences_registry.register
  33 class OrganizationName(StringPreference):
  34     name = "organization_name"
  35     verbose_name = _("Organization name")
  36     default = ""
  37     section = general_global_section
  38     required = False
  39 
  40 
  41 @global_preferences_registry.register
  42 class RelevantQualificationCategories(CustomModelMultipleChoicePreference):
  43     name = "relevant_qualification_categories"
  44     section = general_global_section
  45     model = QualificationCategory
  46     default = QualificationCategory.objects.none()
  47     verbose_name = _("Relevant qualification categories (for user list and disposition view)")
  48     field_kwargs = {"widget": Select2MultipleWidget}
  49 
  50 
  51 @global_preferences_registry.register
  52 class EnabledPlugins(MultipleChoicePreference):
  53     name = "enabled_plugins"
  54     verbose_name = _("Enabled plugins")
  55     default = [
  56         ephios.plugins.basesignup.apps.PluginApp.__module__,
  57         ephios.plugins.pages.apps.PluginApp.__module__,
  58     ]
  59     section = general_global_section
  60     required = False
  61 
  62     @staticmethod
  63     def get_choices():
  64         return [
  65             (plugin.module, mark_safe(f"<strong>{plugin.name}</strong>: {plugin.description}"))
  66             for plugin in plugins.get_all_plugins()
  67             if getattr(plugin, "visible", True)
  68         ]
  69 
  70 
  71 @user_preferences_registry.register
  72 class NotificationPreference(JSONPreference):
  73     name = "notifications"
  74     verbose_name = _("Notification preferences")
  75     section = notifications_user_section
  76     default = dict(
  77         zip(
  78             [not_type.slug for not_type in CORE_NOTIFICATION_TYPES],
  79             [[backend.slug for backend in CORE_NOTIFICATION_BACKENDS]]
  80             * len(CORE_NOTIFICATION_TYPES),
  81         )
  82     )
  83 
  84 
  85 @event_type_preference_registry.register
  86 class VisibleForPreference(CustomModelMultipleChoicePreference):
  87     name = "visible_for"
  88     verbose_name = _("Events of this type should by default be visible for")
  89     model = Group
  90     default = Group.objects.all()
  91     field_kwargs = {"widget": Select2MultipleWidget}
  92 
  93 
  94 @event_type_preference_registry.register
  95 class ResponsibleUsersPreference(CustomModelMultipleChoicePreference):
  96     name = "responsible_users"
  97     verbose_name = _("Users that are responsible for this event type by default")
  98     model = UserProfile
  99     default = UserProfile.objects.none()
  100     field_kwargs = {"widget": Select2MultipleWidget}
  101 
  102 
  103 @event_type_preference_registry.register
  104 class ResponsibleGroupsPreference(CustomModelMultipleChoicePreference):
  105     name = "responsible_groups"
  106     verbose_name = _("Groups that are responsible for this event type by default")
  107     model = Group
  108     default = Group.objects.none()
  109     field_kwargs = {"widget": Select2MultipleWidget}
  110
  [end of ephios/core/dynamic_preferences_registry.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/ephios/core/dynamic_preferences_registry.py b/ephios/core/dynamic_preferences_registry.py
  --- a/ephios/core/dynamic_preferences_registry.py
  +++ b/ephios/core/dynamic_preferences_registry.py
  @@ -7,7 +7,11 @@
       PerInstancePreferenceRegistry,
       global_preferences_registry,
   )
  -from dynamic_preferences.types import MultipleChoicePreference, StringPreference
  +from dynamic_preferences.types import (
  +    ModelMultipleChoicePreference,
  +    MultipleChoicePreference,
  +    StringPreference,
  +)
   from dynamic_preferences.users.registries import user_preferences_registry
   
   import ephios
  @@ -15,7 +19,7 @@
   from ephios.core.models import QualificationCategory, UserProfile
   from ephios.core.services.notifications.backends import CORE_NOTIFICATION_BACKENDS
   from ephios.core.services.notifications.types import CORE_NOTIFICATION_TYPES
  -from ephios.extra.preferences import CustomModelMultipleChoicePreference, JSONPreference
  +from ephios.extra.preferences import JSONPreference
   
   
   class EventTypeRegistry(PerInstancePreferenceRegistry):
  @@ -39,7 +43,7 @@
   
   
   @global_preferences_registry.register
  -class RelevantQualificationCategories(CustomModelMultipleChoicePreference):
  +class RelevantQualificationCategories(ModelMultipleChoicePreference):
       name = "relevant_qualification_categories"
       section = general_global_section
       model = QualificationCategory
  @@ -83,7 +87,7 @@
   
   
   @event_type_preference_registry.register
  -class VisibleForPreference(CustomModelMultipleChoicePreference):
  +class VisibleForPreference(ModelMultipleChoicePreference):
       name = "visible_for"
       verbose_name = _("Events of this type should by default be visible for")
       model = Group
  @@ -92,7 +96,7 @@
   
   
   @event_type_preference_registry.register
  -class ResponsibleUsersPreference(CustomModelMultipleChoicePreference):
  +class ResponsibleUsersPreference(ModelMultipleChoicePreference):
       name = "responsible_users"
       verbose_name = _("Users that are responsible for this event type by default")
       model = UserProfile
  @@ -101,7 +105,7 @@
   
   
   @event_type_preference_registry.register
  -class ResponsibleGroupsPreference(CustomModelMultipleChoicePreference):
  +class ResponsibleGroupsPreference(ModelMultipleChoicePreference):
       name = "responsible_groups"
       verbose_name = _("Groups that are responsible for this event type by default")
       model = Group
  diff --git a/ephios/extra/preferences.py b/ephios/extra/preferences.py
  --- a/ephios/extra/preferences.py
  +++ b/ephios/extra/preferences.py
  @@ -1,20 +1,11 @@
   import json
   
   from django import forms
  -from dynamic_preferences.types import (
  -    BasePreferenceType,
  -    BaseSerializer,
  -    ModelMultipleChoicePreference,
  -)
  +from dynamic_preferences.types import BasePreferenceType, BaseSerializer
   
   from ephios.extra.json import CustomJSONDecoder, CustomJSONEncoder
   
   
  -class CustomModelMultipleChoicePreference(ModelMultipleChoicePreference):
  -    def _setup_signals(self):
  -        pass
  -
  -
   class JSONSerializer(BaseSerializer):
       @classmethod
       def clean_to_db_value(cls, value):
  
verification_info: {"golden_diff": "diff --git a/ephios/core/dynamic_preferences_registry.py b/ephios/core/dynamic_preferences_registry.py\n--- a/ephios/core/dynamic_preferences_registry.py\n+++ b/ephios/core/dynamic_preferences_registry.py\n@@ -7,7 +7,11 @@\n     PerInstancePreferenceRegistry,\n     global_preferences_registry,\n )\n-from dynamic_preferences.types import MultipleChoicePreference, StringPreference\n+from dynamic_preferences.types import (\n+    ModelMultipleChoicePreference,\n+    MultipleChoicePreference,\n+    StringPreference,\n+)\n from dynamic_preferences.users.registries import user_preferences_registry\n \n import ephios\n@@ -15,7 +19,7 @@\n from ephios.core.models import QualificationCategory, UserProfile\n from ephios.core.services.notifications.backends import CORE_NOTIFICATION_BACKENDS\n from ephios.core.services.notifications.types import CORE_NOTIFICATION_TYPES\n-from ephios.extra.preferences import CustomModelMultipleChoicePreference, JSONPreference\n+from ephios.extra.preferences import JSONPreference\n \n \n class EventTypeRegistry(PerInstancePreferenceRegistry):\n@@ -39,7 +43,7 @@\n \n \n @global_preferences_registry.register\n-class RelevantQualificationCategories(CustomModelMultipleChoicePreference):\n+class RelevantQualificationCategories(ModelMultipleChoicePreference):\n     name = \"relevant_qualification_categories\"\n     section = general_global_section\n     model = QualificationCategory\n@@ -83,7 +87,7 @@\n \n \n @event_type_preference_registry.register\n-class VisibleForPreference(CustomModelMultipleChoicePreference):\n+class VisibleForPreference(ModelMultipleChoicePreference):\n     name = \"visible_for\"\n     verbose_name = _(\"Events of this type should by default be visible for\")\n     model = Group\n@@ -92,7 +96,7 @@\n \n \n @event_type_preference_registry.register\n-class ResponsibleUsersPreference(CustomModelMultipleChoicePreference):\n+class ResponsibleUsersPreference(ModelMultipleChoicePreference):\n     name = \"responsible_users\"\n     verbose_name = _(\"Users that are responsible for this event type by default\")\n     model = UserProfile\n@@ -101,7 +105,7 @@\n \n \n @event_type_preference_registry.register\n-class ResponsibleGroupsPreference(CustomModelMultipleChoicePreference):\n+class ResponsibleGroupsPreference(ModelMultipleChoicePreference):\n     name = \"responsible_groups\"\n     verbose_name = _(\"Groups that are responsible for this event type by default\")\n     model = Group\ndiff --git a/ephios/extra/preferences.py b/ephios/extra/preferences.py\n--- a/ephios/extra/preferences.py\n+++ b/ephios/extra/preferences.py\n@@ -1,20 +1,11 @@\n import json\n \n from django import forms\n-from dynamic_preferences.types import (\n-    BasePreferenceType,\n-    BaseSerializer,\n-    ModelMultipleChoicePreference,\n-)\n+from dynamic_preferences.types import BasePreferenceType, BaseSerializer\n \n from ephios.extra.json import CustomJSONDecoder, CustomJSONEncoder\n \n \n-class CustomModelMultipleChoicePreference(ModelMultipleChoicePreference):\n-    def _setup_signals(self):\n-        pass\n-\n-\n class JSONSerializer(BaseSerializer):\n     @classmethod\n     def clean_to_db_value(cls, value):\n", "issue": "Remove CustomMultipleChoicePreference\nAs of https://github.com/agateblue/django-dynamic-preferences/pull/235 we can drop our own fix of the MultiplChoicePreference class (as soon as this is part of a release)\nRemove CustomMultipleChoicePreference\nAs of https://github.com/agateblue/django-dynamic-preferences/pull/235 we can drop our own fix of the MultiplChoicePreference class (as soon as this is part of a release)\n", "before_files": [{"content": "import json\n\nfrom django import forms\nfrom dynamic_preferences.types import (\n    BasePreferenceType,\n    BaseSerializer,\n    ModelMultipleChoicePreference,\n)\n\nfrom ephios.extra.json import CustomJSONDecoder, CustomJSONEncoder\n\n\nclass CustomModelMultipleChoicePreference(ModelMultipleChoicePreference):\n    def _setup_signals(self):\n        pass\n\n\nclass JSONSerializer(BaseSerializer):\n    @classmethod\n    def clean_to_db_value(cls, value):\n        return json.dumps(value, cls=CustomJSONEncoder, ensure_ascii=False)\n\n    @classmethod\n    def to_python(cls, value, **kwargs):\n        return json.loads(value, cls=CustomJSONDecoder)\n\n\nclass JSONPreference(BasePreferenceType):\n    serializer = JSONSerializer\n    field_class = forms.CharField\n    widget = forms.Textarea\n", "path": "ephios/extra/preferences.py"}, {"content": "from django.contrib.auth.models import Group\nfrom django.utils.safestring import mark_safe\nfrom django.utils.translation import gettext_lazy as _\nfrom django_select2.forms import Select2MultipleWidget\nfrom dynamic_preferences.preferences import Section\nfrom dynamic_preferences.registries import (\n    PerInstancePreferenceRegistry,\n    global_preferences_registry,\n)\nfrom dynamic_preferences.types import MultipleChoicePreference, StringPreference\nfrom dynamic_preferences.users.registries import user_preferences_registry\n\nimport ephios\nfrom ephios.core import plugins\nfrom ephios.core.models import QualificationCategory, UserProfile\nfrom ephios.core.services.notifications.backends import CORE_NOTIFICATION_BACKENDS\nfrom ephios.core.services.notifications.types import CORE_NOTIFICATION_TYPES\nfrom ephios.extra.preferences import CustomModelMultipleChoicePreference, JSONPreference\n\n\nclass EventTypeRegistry(PerInstancePreferenceRegistry):\n    pass\n\n\nevent_type_preference_registry = EventTypeRegistry()\n\nnotifications_user_section = Section(\"notifications\")\nresponsible_notifications_user_section = Section(\"responsible_notifications\")\ngeneral_global_section = Section(\"general\")\n\n\n@global_preferences_registry.register\nclass OrganizationName(StringPreference):\n    name = \"organization_name\"\n    verbose_name = _(\"Organization name\")\n    default = \"\"\n    section = general_global_section\n    required = False\n\n\n@global_preferences_registry.register\nclass RelevantQualificationCategories(CustomModelMultipleChoicePreference):\n    name = \"relevant_qualification_categories\"\n    section = general_global_section\n    model = QualificationCategory\n    default = QualificationCategory.objects.none()\n    verbose_name = _(\"Relevant qualification categories (for user list and disposition view)\")\n    field_kwargs = {\"widget\": Select2MultipleWidget}\n\n\n@global_preferences_registry.register\nclass EnabledPlugins(MultipleChoicePreference):\n    name = \"enabled_plugins\"\n    verbose_name = _(\"Enabled plugins\")\n    default = [\n        ephios.plugins.basesignup.apps.PluginApp.__module__,\n        ephios.plugins.pages.apps.PluginApp.__module__,\n    ]\n    section = general_global_section\n    required = False\n\n    @staticmethod\n    def get_choices():\n        return [\n            (plugin.module, mark_safe(f\"<strong>{plugin.name}</strong>: {plugin.description}\"))\n            for plugin in plugins.get_all_plugins()\n            if getattr(plugin, \"visible\", True)\n        ]\n\n\n@user_preferences_registry.register\nclass NotificationPreference(JSONPreference):\n    name = \"notifications\"\n    verbose_name = _(\"Notification preferences\")\n    section = notifications_user_section\n    default = dict(\n        zip(\n            [not_type.slug for not_type in CORE_NOTIFICATION_TYPES],\n            [[backend.slug for backend in CORE_NOTIFICATION_BACKENDS]]\n            * len(CORE_NOTIFICATION_TYPES),\n        )\n    )\n\n\n@event_type_preference_registry.register\nclass VisibleForPreference(CustomModelMultipleChoicePreference):\n    name = \"visible_for\"\n    verbose_name = _(\"Events of this type should by default be visible for\")\n    model = Group\n    default = Group.objects.all()\n    field_kwargs = {\"widget\": Select2MultipleWidget}\n\n\n@event_type_preference_registry.register\nclass ResponsibleUsersPreference(CustomModelMultipleChoicePreference):\n    name = \"responsible_users\"\n    verbose_name = _(\"Users that are responsible for this event type by default\")\n    model = UserProfile\n    default = UserProfile.objects.none()\n    field_kwargs = {\"widget\": Select2MultipleWidget}\n\n\n@event_type_preference_registry.register\nclass ResponsibleGroupsPreference(CustomModelMultipleChoicePreference):\n    name = \"responsible_groups\"\n    verbose_name = _(\"Groups that are responsible for this event type by default\")\n    model = Group\n    default = Group.objects.none()\n    field_kwargs = {\"widget\": Select2MultipleWidget}\n", "path": "ephios/core/dynamic_preferences_registry.py"}]}