diff --git a/pretalx_musicrate/forms.py b/pretalx_musicrate/forms.py index 2b92a32..b263baa 100644 --- a/pretalx_musicrate/forms.py +++ b/pretalx_musicrate/forms.py @@ -1,17 +1,14 @@ - from i18nfield.forms import I18nModelForm from .models import MusicrateSettings class MusicrateSettingsForm(I18nModelForm): - def __init__(self, *args, event=None, **kwargs): self.instance, _ = MusicrateSettings.objects.get_or_create(event=event) super().__init__(*args, **kwargs, instance=self.instance, locales=event.locales) class Meta: model = MusicrateSettings - fields = ("some_setting", ) + fields = ("some_setting",) widgets = {} - diff --git a/pretalx_musicrate/models.py b/pretalx_musicrate/models.py index d819642..387223e 100644 --- a/pretalx_musicrate/models.py +++ b/pretalx_musicrate/models.py @@ -1,8 +1,6 @@ from django.db import models - - class MusicrateSettings(models.Model): event = models.OneToOneField( to="event.Event", @@ -10,4 +8,3 @@ class MusicrateSettings(models.Model): related_name="pretalx_musicrate_settings", ) some_setting = models.CharField(max_length=10, default="A") - diff --git a/pretalx_musicrate/signals.py b/pretalx_musicrate/signals.py index a3eccf3..9cd0437 100644 --- a/pretalx_musicrate/signals.py +++ b/pretalx_musicrate/signals.py @@ -1,4 +1,3 @@ - from django.dispatch import receiver from django.urls import reverse from pretalx.orga.signals import nav_event_settings @@ -19,4 +18,3 @@ def pretalx_musicrate_settings(sender, request, **kwargs): == "plugins:pretalx_musicrate:settings", } ] - diff --git a/pretalx_musicrate/urls.py b/pretalx_musicrate/urls.py index b0d0b19..96e2f4d 100644 --- a/pretalx_musicrate/urls.py +++ b/pretalx_musicrate/urls.py @@ -1,4 +1,3 @@ - from django.urls import re_path from pretalx.event.models.event import SLUG_REGEX @@ -11,4 +10,3 @@ urlpatterns = [ name="settings", ), ] - diff --git a/pretalx_musicrate/views.py b/pretalx_musicrate/views.py index 8afbb0e..e1fa627 100644 --- a/pretalx_musicrate/views.py +++ b/pretalx_musicrate/views.py @@ -3,7 +3,6 @@ from django.utils.translation import gettext_lazy as _ from django.views.generic import FormView from pretalx.common.mixins.views import PermissionRequired - from .forms import MusicrateSettingsForm @@ -25,6 +24,7 @@ class MusicrateSettingsView(PermissionRequired, FormView): def form_valid(self, form): form.save() - messages.success(self.request, _("The pretalx musicrate plugin settings were updated.")) + messages.success( + self.request, _("The pretalx musicrate plugin settings were updated.") + ) return super().form_valid(form) -