From 81de10b70c85c5222b17d8c4358a8aa8812f2559 Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Fri, 18 Nov 2022 08:28:15 -0700 Subject: Migration reset, start of docs, env vars --- core/apps.py | 3 --- core/migrations/0001_initial.py | 14 +++++++++++--- core/migrations/0002_alter_config_image.py | 28 ---------------------------- core/models/config.py | 2 +- 4 files changed, 12 insertions(+), 35 deletions(-) delete mode 100644 core/migrations/0002_alter_config_image.py (limited to 'core') diff --git a/core/apps.py b/core/apps.py index 54693d5..6098f6b 100644 --- a/core/apps.py +++ b/core/apps.py @@ -9,7 +9,4 @@ class CoreConfig(AppConfig): name = "core" def ready(self) -> None: - from core.models import Config - - Config.system = Config.load_system() jsonld.set_document_loader(builtin_document_loader) diff --git a/core/migrations/0001_initial.py b/core/migrations/0001_initial.py index 2c4731f..900260f 100644 --- a/core/migrations/0001_initial.py +++ b/core/migrations/0001_initial.py @@ -1,16 +1,20 @@ -# Generated by Django 4.1.3 on 2022-11-16 21:23 +# Generated by Django 4.1.3 on 2022-11-18 17:49 + +import functools import django.db.models.deletion from django.conf import settings from django.db import migrations, models +import core.uploads + class Migration(migrations.Migration): initial = True dependencies = [ - ("users", "0002_identity_public_key_id"), + ("users", "0001_initial"), migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] @@ -32,7 +36,11 @@ class Migration(migrations.Migration): ( "image", models.ImageField( - blank=True, null=True, upload_to="config/%Y/%m/%d/" + blank=True, + null=True, + upload_to=functools.partial( + core.uploads.upload_namer, *("config",), **{} + ), ), ), ( diff --git a/core/migrations/0002_alter_config_image.py b/core/migrations/0002_alter_config_image.py deleted file mode 100644 index 86dcebb..0000000 --- a/core/migrations/0002_alter_config_image.py +++ /dev/null @@ -1,28 +0,0 @@ -# Generated by Django 4.1.3 on 2022-11-18 01:40 - -import functools - -from django.db import migrations, models - -import core.uploads - - -class Migration(migrations.Migration): - - dependencies = [ - ("core", "0001_initial"), - ] - - operations = [ - migrations.AlterField( - model_name="config", - name="image", - field=models.ImageField( - blank=True, - null=True, - upload_to=functools.partial( - core.uploads.upload_namer, *("config",), **{} - ), - ), - ), - ] diff --git a/core/models/config.py b/core/models/config.py index 2a27d2e..57d9e55 100644 --- a/core/models/config.py +++ b/core/models/config.py @@ -160,7 +160,7 @@ class Config(models.Model): site_icon: UploadedImage = static("img/icon-128.png") site_banner: UploadedImage = static("img/fjords-banner-600.jpg") - signup_allowed: bool = False + signup_allowed: bool = True signup_invite_only: bool = False signup_text: str = "" -- cgit v1.2.3