From e8deebae0c15246a4a476b4f308c54d3b9018955 Mon Sep 17 00:00:00 2001 From: Luca Date: Fri, 21 Apr 2023 21:26:07 +0200 Subject: [PATCH] Reformat code --- shiftregister/app/context_processors.py | 1 + shiftregister/app/migrations/0001_initial.py | 1 - shiftregister/app/migrations/0002_message_sent_at.py | 1 - shiftregister/app/migrations/0003_logintoken_send_count.py | 1 - shiftregister/app/migrations/0004_shift_required_helpers.py | 1 - .../0005_shift_description_alter_shift_required_helpers.py | 1 - shiftregister/app/migrations/0006_alter_shift_description.py | 1 - shiftregister/app/migrations/0007_shiftregistration_state.py | 1 - shiftregister/app/migrations/0008_alter_message_sent_at.py | 1 - shiftregister/app/migrations/0009_helper_asta_confirmed.py | 1 - shiftregister/app/migrations/0010_room_meeting_location.py | 1 - shiftregister/app/migrations/0011_room_description.py | 1 - shiftregister/importer/migrations/0001_initial.py | 1 - shiftregister/metrics/views.py | 1 - shiftregister/pages/migrations/0001_initial.py | 1 - shiftregister/pages/models.py | 2 ++ shiftregister/pages/views.py | 2 ++ shiftregister/signage/forms.py | 4 +++- shiftregister/signage/migrations/0001_initial.py | 1 - shiftregister/signage/views.py | 1 + shiftregister/team/forms.py | 1 + shiftregister/team/views.py | 1 + 22 files changed, 11 insertions(+), 16 deletions(-) diff --git a/shiftregister/app/context_processors.py b/shiftregister/app/context_processors.py index e5d0961..dc1d843 100644 --- a/shiftregister/app/context_processors.py +++ b/shiftregister/app/context_processors.py @@ -1,6 +1,7 @@ from django.conf import settings from .models import LoginToken + # enhance template contexts with frequently used data so we have less code duplication def proc(request): context = { diff --git a/shiftregister/app/migrations/0001_initial.py b/shiftregister/app/migrations/0001_initial.py index 544b9f2..4beb487 100644 --- a/shiftregister/app/migrations/0001_initial.py +++ b/shiftregister/app/migrations/0001_initial.py @@ -7,7 +7,6 @@ import shiftregister.app.models class Migration(migrations.Migration): - initial = True dependencies = [] diff --git a/shiftregister/app/migrations/0002_message_sent_at.py b/shiftregister/app/migrations/0002_message_sent_at.py index 8aaea36..b3eaf40 100644 --- a/shiftregister/app/migrations/0002_message_sent_at.py +++ b/shiftregister/app/migrations/0002_message_sent_at.py @@ -4,7 +4,6 @@ from django.db import migrations, models class Migration(migrations.Migration): - dependencies = [ ("app", "0001_initial"), ] diff --git a/shiftregister/app/migrations/0003_logintoken_send_count.py b/shiftregister/app/migrations/0003_logintoken_send_count.py index 0ebb417..bf5f0de 100644 --- a/shiftregister/app/migrations/0003_logintoken_send_count.py +++ b/shiftregister/app/migrations/0003_logintoken_send_count.py @@ -4,7 +4,6 @@ from django.db import migrations, models class Migration(migrations.Migration): - dependencies = [ ("app", "0002_message_sent_at"), ] diff --git a/shiftregister/app/migrations/0004_shift_required_helpers.py b/shiftregister/app/migrations/0004_shift_required_helpers.py index 7d42bfc..6d4172d 100644 --- a/shiftregister/app/migrations/0004_shift_required_helpers.py +++ b/shiftregister/app/migrations/0004_shift_required_helpers.py @@ -4,7 +4,6 @@ from django.db import migrations, models class Migration(migrations.Migration): - dependencies = [ ("app", "0003_logintoken_send_count"), ] diff --git a/shiftregister/app/migrations/0005_shift_description_alter_shift_required_helpers.py b/shiftregister/app/migrations/0005_shift_description_alter_shift_required_helpers.py index dc34b48..3fcfe2d 100644 --- a/shiftregister/app/migrations/0005_shift_description_alter_shift_required_helpers.py +++ b/shiftregister/app/migrations/0005_shift_description_alter_shift_required_helpers.py @@ -4,7 +4,6 @@ from django.db import migrations, models class Migration(migrations.Migration): - dependencies = [ ("app", "0004_shift_required_helpers"), ] diff --git a/shiftregister/app/migrations/0006_alter_shift_description.py b/shiftregister/app/migrations/0006_alter_shift_description.py index 622af8d..a626d39 100644 --- a/shiftregister/app/migrations/0006_alter_shift_description.py +++ b/shiftregister/app/migrations/0006_alter_shift_description.py @@ -4,7 +4,6 @@ from django.db import migrations, models class Migration(migrations.Migration): - dependencies = [ ("app", "0005_shift_description_alter_shift_required_helpers"), ] diff --git a/shiftregister/app/migrations/0007_shiftregistration_state.py b/shiftregister/app/migrations/0007_shiftregistration_state.py index 10c1bdc..abc2d2f 100644 --- a/shiftregister/app/migrations/0007_shiftregistration_state.py +++ b/shiftregister/app/migrations/0007_shiftregistration_state.py @@ -4,7 +4,6 @@ from django.db import migrations, models class Migration(migrations.Migration): - dependencies = [ ("app", "0006_alter_shift_description"), ] diff --git a/shiftregister/app/migrations/0008_alter_message_sent_at.py b/shiftregister/app/migrations/0008_alter_message_sent_at.py index 7273d2e..4206b07 100644 --- a/shiftregister/app/migrations/0008_alter_message_sent_at.py +++ b/shiftregister/app/migrations/0008_alter_message_sent_at.py @@ -4,7 +4,6 @@ from django.db import migrations, models class Migration(migrations.Migration): - dependencies = [ ("app", "0007_shiftregistration_state"), ] diff --git a/shiftregister/app/migrations/0009_helper_asta_confirmed.py b/shiftregister/app/migrations/0009_helper_asta_confirmed.py index f50931d..5f4ffa1 100644 --- a/shiftregister/app/migrations/0009_helper_asta_confirmed.py +++ b/shiftregister/app/migrations/0009_helper_asta_confirmed.py @@ -4,7 +4,6 @@ from django.db import migrations, models class Migration(migrations.Migration): - dependencies = [ ("app", "0008_alter_message_sent_at"), ] diff --git a/shiftregister/app/migrations/0010_room_meeting_location.py b/shiftregister/app/migrations/0010_room_meeting_location.py index e7a6cb9..1710d88 100644 --- a/shiftregister/app/migrations/0010_room_meeting_location.py +++ b/shiftregister/app/migrations/0010_room_meeting_location.py @@ -4,7 +4,6 @@ from django.db import migrations, models class Migration(migrations.Migration): - dependencies = [ ("app", "0009_helper_asta_confirmed"), ] diff --git a/shiftregister/app/migrations/0011_room_description.py b/shiftregister/app/migrations/0011_room_description.py index e6abba8..8f3dc39 100644 --- a/shiftregister/app/migrations/0011_room_description.py +++ b/shiftregister/app/migrations/0011_room_description.py @@ -4,7 +4,6 @@ from django.db import migrations, models class Migration(migrations.Migration): - dependencies = [ ("app", "0010_room_meeting_location"), ] diff --git a/shiftregister/importer/migrations/0001_initial.py b/shiftregister/importer/migrations/0001_initial.py index 1d6b6ba..4b6bda4 100644 --- a/shiftregister/importer/migrations/0001_initial.py +++ b/shiftregister/importer/migrations/0001_initial.py @@ -5,7 +5,6 @@ import django.db.models.deletion class Migration(migrations.Migration): - initial = True dependencies = [ diff --git a/shiftregister/metrics/views.py b/shiftregister/metrics/views.py index 724544c..92166ec 100644 --- a/shiftregister/metrics/views.py +++ b/shiftregister/metrics/views.py @@ -5,7 +5,6 @@ from django.db import models def metrics(request): - help_wanted = Q(required_helpers__gt=F("reg_count")) | Q(required_helpers=0) & Q( room__required_helpers__gt=F("reg_count") ) diff --git a/shiftregister/pages/migrations/0001_initial.py b/shiftregister/pages/migrations/0001_initial.py index 2ad9d22..03e411a 100644 --- a/shiftregister/pages/migrations/0001_initial.py +++ b/shiftregister/pages/migrations/0001_initial.py @@ -4,7 +4,6 @@ from django.db import migrations, models class Migration(migrations.Migration): - initial = True dependencies = [] diff --git a/shiftregister/pages/models.py b/shiftregister/pages/models.py index 2ee6197..ec75262 100644 --- a/shiftregister/pages/models.py +++ b/shiftregister/pages/models.py @@ -1,6 +1,8 @@ from django.db import models # Create your models here. + + class Page(models.Model): url = models.fields.SlugField(unique=True) content = models.TextField() diff --git a/shiftregister/pages/views.py b/shiftregister/pages/views.py index 785ae66..9b09722 100644 --- a/shiftregister/pages/views.py +++ b/shiftregister/pages/views.py @@ -3,6 +3,8 @@ from django.shortcuts import render from .models import Page # Create your views here. + + class PageView(DetailView): template_name = "page.html" queryset = Page.objects.filter(visible=True) diff --git a/shiftregister/signage/forms.py b/shiftregister/signage/forms.py index 18c2173..b677aca 100644 --- a/shiftregister/signage/forms.py +++ b/shiftregister/signage/forms.py @@ -2,4 +2,6 @@ from django import forms class TeamBackupForm(forms.Form): - name = forms.CharField(max_length=100, widget=forms.TextInput(attrs={"class": "input"})) + name = forms.CharField( + max_length=100, widget=forms.TextInput(attrs={"class": "input"}) + ) diff --git a/shiftregister/signage/migrations/0001_initial.py b/shiftregister/signage/migrations/0001_initial.py index b71b542..f967012 100644 --- a/shiftregister/signage/migrations/0001_initial.py +++ b/shiftregister/signage/migrations/0001_initial.py @@ -5,7 +5,6 @@ import django.db.models.deletion class Migration(migrations.Migration): - initial = True dependencies = [ diff --git a/shiftregister/signage/views.py b/shiftregister/signage/views.py index d69f47b..755e6fb 100644 --- a/shiftregister/signage/views.py +++ b/shiftregister/signage/views.py @@ -10,6 +10,7 @@ from datetime import timedelta from django.db.models import DateTimeField from datetime import date, datetime, time + # Create your views here. @login_required def worklist(request): diff --git a/shiftregister/team/forms.py b/shiftregister/team/forms.py index 3e4e01d..7faa094 100644 --- a/shiftregister/team/forms.py +++ b/shiftregister/team/forms.py @@ -1,6 +1,7 @@ from django import forms from .models import ShiftRegistration, Helper + # placeholder form for simple submit button use cases so we get csrf protection class EmptyForm(forms.Form): pass diff --git a/shiftregister/team/views.py b/shiftregister/team/views.py index c2626bc..2e900ca 100644 --- a/shiftregister/team/views.py +++ b/shiftregister/team/views.py @@ -10,6 +10,7 @@ from django.contrib import messages from django.db import models from .forms import BulkMessage, HelperShift + # Create your views here. def index(request): pass