From 250f203900b0421da809738694d58d541a52cfd1 Mon Sep 17 00:00:00 2001 From: Benjamin Bach Date: Sat, 20 Jul 2024 22:45:44 +0200 Subject: [PATCH] Fix some issues after merge conflixts --- Dockerfile | 12 +++++------- pyproject.toml | 2 +- src/membership/admin.py | 4 ---- ...0006_waitinglistentry_alter_membership_options.py | 4 ++-- src/membership/models.py | 2 +- src/pytest.ini | 5 ----- 6 files changed, 9 insertions(+), 20 deletions(-) delete mode 100644 src/pytest.ini diff --git a/Dockerfile b/Dockerfile index 16219b3..2e9448d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,9 +15,7 @@ WORKDIR /app RUN groupadd -g 1000 www && useradd -u 1000 -ms /bin/bash -g www www COPY --chown=www:www . . -RUN mkdir /app/src/static && \ - chown www:www /app/src/static && \ - apt-get update && \ +RUN apt-get update && \ apt-get install -y \ binutils \ libpq-dev \ @@ -33,11 +31,11 @@ RUN mkdir /app/src/static && \ COPY --chown=www:www . . -RUN mkdir /app/src/static \ - && chown www:www /app/src/static +RUN mkdir /app/src/static && \ + chown www:www /app/src/static -RUN pip install --no-cache-dir -r $REQUIREMENTS_FILE && \ - && django-admin compilemessages +RUN pip install --no-cache-dir -r $REQUIREMENTS_FILE +RUN django-admin compilemessages ENTRYPOINT ["./entrypoint.sh"] diff --git a/pyproject.toml b/pyproject.toml index 5874616..643b1cd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -125,7 +125,7 @@ extend-exclude = [ line-length = 120 [tool.ruff.lint] -# select = ["ALL"] +select = ["ALL"] ignore = [ "G004", # Logging statement uses f-string "ANN101", # Missing type annotation for `self` in method diff --git a/src/membership/admin.py b/src/membership/admin.py index 0f84066..b16e2a1 100644 --- a/src/membership/admin.py +++ b/src/membership/admin.py @@ -19,11 +19,7 @@ class MembershipTypeAdmin(admin.ModelAdmin): class SubscriptionPeriodAdmin(admin.ModelAdmin): """Admin for SubscriptionPeriod model.""" - pass - @admin.register(models.WaitingListEntry) class WaitingListEntryAdmin(admin.ModelAdmin): """Admin for WaitingList model.""" - - pass diff --git a/src/membership/migrations/0006_waitinglistentry_alter_membership_options.py b/src/membership/migrations/0006_waitinglistentry_alter_membership_options.py index a993b63..9c2d923 100644 --- a/src/membership/migrations/0006_waitinglistentry_alter_membership_options.py +++ b/src/membership/migrations/0006_waitinglistentry_alter_membership_options.py @@ -1,4 +1,4 @@ -# Generated by Django 5.0.6 on 2024-07-14 16:22 +# Generated by Django 5.0.7 on 2024-07-20 20:45 from django.db import migrations, models @@ -17,7 +17,7 @@ class Migration(migrations.Migration): ('modified', models.DateTimeField(auto_now=True, verbose_name='modified')), ('created', models.DateTimeField(auto_now_add=True, verbose_name='created')), ('email', models.EmailField(max_length=254)), - ('geography', models.CharField(blank=True, null=True, verbose_name='geography')), + ('geography', models.CharField(blank=True, default='', verbose_name='geography')), ('comment', models.TextField(blank=True)), ], options={ diff --git a/src/membership/models.py b/src/membership/models.py index 69bdd4e..4fec013 100644 --- a/src/membership/models.py +++ b/src/membership/models.py @@ -145,7 +145,7 @@ class WaitingListEntry(CreatedModifiedAbstract): """People who for some reason could want to be added to a waiting list and invited to join later.""" email = models.EmailField() - geography = models.CharField(verbose_name=_("geography"), blank=True, null=True) + geography = models.CharField(verbose_name=_("geography"), blank=True, default="") comment = models.TextField(blank=True) def __str__(self) -> str: diff --git a/src/pytest.ini b/src/pytest.ini deleted file mode 100644 index 9929fa7..0000000 --- a/src/pytest.ini +++ /dev/null @@ -1,5 +0,0 @@ -[pytest] -testpaths = . -python_files = tests.py test_*.py *_tests.py -DJANGO_SETTINGS_MODULE = project.settings -#norecursedirs = dist tmp* .svn .*