mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-23 08:36:32 +00:00
Python formatting
This commit is contained in:
parent
2883c42534
commit
63558bb75e
4 changed files with 7 additions and 9 deletions
|
@ -59,9 +59,7 @@ class RegisterForm(CustomForm):
|
||||||
cleaned_data = super().clean()
|
cleaned_data = super().clean()
|
||||||
localname = cleaned_data.get("localname").strip()
|
localname = cleaned_data.get("localname").strip()
|
||||||
if models.User.objects.filter(localname=localname).first():
|
if models.User.objects.filter(localname=localname).first():
|
||||||
self.add_error(
|
self.add_error("localname", _("User with this username already exists"))
|
||||||
"localname", _("User with this username already exists")
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class RatingForm(CustomForm):
|
class RatingForm(CustomForm):
|
||||||
|
|
|
@ -3,10 +3,12 @@ from django.core.management.base import BaseCommand
|
||||||
|
|
||||||
from bookwyrm import models
|
from bookwyrm import models
|
||||||
|
|
||||||
|
|
||||||
def get_admin_code():
|
def get_admin_code():
|
||||||
"""get that code"""
|
"""get that code"""
|
||||||
return models.SiteSettings.objects.get().admin_code
|
return models.SiteSettings.objects.get().admin_code
|
||||||
|
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
"""command-line options"""
|
"""command-line options"""
|
||||||
|
|
||||||
|
|
|
@ -6,13 +6,13 @@ from django.db import migrations, models
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('bookwyrm', '0136_auto_20220217_1708'),
|
("bookwyrm", "0136_auto_20220217_1708"),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='sitesettings',
|
model_name="sitesettings",
|
||||||
name='allow_registration',
|
name="allow_registration",
|
||||||
field=models.BooleanField(default=False),
|
field=models.BooleanField(default=False),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -22,9 +22,7 @@ class CreateAdmin(View):
|
||||||
if not site.install_mode:
|
if not site.install_mode:
|
||||||
raise PermissionDenied()
|
raise PermissionDenied()
|
||||||
|
|
||||||
data = {
|
data = {"register_form": forms.RegisterForm()}
|
||||||
"register_form": forms.RegisterForm()
|
|
||||||
}
|
|
||||||
return TemplateResponse(request, "setup/admin.html", data)
|
return TemplateResponse(request, "setup/admin.html", data)
|
||||||
|
|
||||||
@transaction.atomic
|
@transaction.atomic
|
||||||
|
|
Loading…
Reference in a new issue