From 63558bb75e501df4ff821b40d9b4f2edf3817440 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Thu, 17 Feb 2022 11:31:52 -0800 Subject: [PATCH] Python formatting --- bookwyrm/forms.py | 4 +--- bookwyrm/management/commands/admin_code.py | 2 ++ .../0137_alter_sitesettings_allow_registration.py | 6 +++--- bookwyrm/views/setup.py | 4 +--- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/bookwyrm/forms.py b/bookwyrm/forms.py index b96e152f..cb9a1e97 100644 --- a/bookwyrm/forms.py +++ b/bookwyrm/forms.py @@ -59,9 +59,7 @@ class RegisterForm(CustomForm): cleaned_data = super().clean() localname = cleaned_data.get("localname").strip() if models.User.objects.filter(localname=localname).first(): - self.add_error( - "localname", _("User with this username already exists") - ) + self.add_error("localname", _("User with this username already exists")) class RatingForm(CustomForm): diff --git a/bookwyrm/management/commands/admin_code.py b/bookwyrm/management/commands/admin_code.py index 73531109..edb8673d 100644 --- a/bookwyrm/management/commands/admin_code.py +++ b/bookwyrm/management/commands/admin_code.py @@ -3,10 +3,12 @@ from django.core.management.base import BaseCommand from bookwyrm import models + def get_admin_code(): """get that code""" return models.SiteSettings.objects.get().admin_code + class Command(BaseCommand): """command-line options""" diff --git a/bookwyrm/migrations/0137_alter_sitesettings_allow_registration.py b/bookwyrm/migrations/0137_alter_sitesettings_allow_registration.py index 8f2df457..ba5000ac 100644 --- a/bookwyrm/migrations/0137_alter_sitesettings_allow_registration.py +++ b/bookwyrm/migrations/0137_alter_sitesettings_allow_registration.py @@ -6,13 +6,13 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ('bookwyrm', '0136_auto_20220217_1708'), + ("bookwyrm", "0136_auto_20220217_1708"), ] operations = [ migrations.AlterField( - model_name='sitesettings', - name='allow_registration', + model_name="sitesettings", + name="allow_registration", field=models.BooleanField(default=False), ), ] diff --git a/bookwyrm/views/setup.py b/bookwyrm/views/setup.py index 2d70a717..12ec91f3 100644 --- a/bookwyrm/views/setup.py +++ b/bookwyrm/views/setup.py @@ -22,9 +22,7 @@ class CreateAdmin(View): if not site.install_mode: raise PermissionDenied() - data = { - "register_form": forms.RegisterForm() - } + data = {"register_form": forms.RegisterForm()} return TemplateResponse(request, "setup/admin.html", data) @transaction.atomic