mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 02:11:08 -05:00
- Cleaned up and standardized assertions in ApiTestMixin for API response validation. - Updated ASGI settings to use os.environ for setting the DJANGO_SETTINGS_MODULE. - Removed unused imports and improved formatting in settings.py. - Refactored URL patterns in urls.py for better readability and organization. - Enhanced view functions in views.py for consistency and clarity. - Added .flake8 configuration for linting and style enforcement. - Introduced type stubs for django-environ to improve type checking with Pylance.
142 lines
5.9 KiB
Python
142 lines
5.9 KiB
Python
# Generated by Django 5.1.4 on 2025-08-13 21:35
|
|
|
|
import django.db.models.deletion
|
|
import pgtrigger.compiler
|
|
import pgtrigger.migrations
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
("pghistory", "0006_delete_aggregateevent"),
|
|
("sites", "0002_alter_domain_unique"),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name="EmailConfiguration",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.BigAutoField(
|
|
auto_created=True,
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="ID",
|
|
),
|
|
),
|
|
("api_key", models.CharField(max_length=255)),
|
|
("from_email", models.EmailField(max_length=254)),
|
|
(
|
|
"from_name",
|
|
models.CharField(
|
|
help_text="The name that will appear in the From field of emails",
|
|
max_length=255,
|
|
),
|
|
),
|
|
("reply_to", models.EmailField(max_length=254)),
|
|
("created_at", models.DateTimeField(auto_now_add=True)),
|
|
("updated_at", models.DateTimeField(auto_now=True)),
|
|
(
|
|
"site",
|
|
models.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
to="sites.site",
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "Email Configuration",
|
|
"verbose_name_plural": "Email Configurations",
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="EmailConfigurationEvent",
|
|
fields=[
|
|
(
|
|
"pgh_id",
|
|
models.AutoField(primary_key=True, serialize=False),
|
|
),
|
|
("pgh_created_at", models.DateTimeField(auto_now_add=True)),
|
|
("pgh_label", models.TextField(help_text="The event label.")),
|
|
("id", models.BigIntegerField()),
|
|
("api_key", models.CharField(max_length=255)),
|
|
("from_email", models.EmailField(max_length=254)),
|
|
(
|
|
"from_name",
|
|
models.CharField(
|
|
help_text="The name that will appear in the From field of emails",
|
|
max_length=255,
|
|
),
|
|
),
|
|
("reply_to", models.EmailField(max_length=254)),
|
|
("created_at", models.DateTimeField(auto_now_add=True)),
|
|
("updated_at", models.DateTimeField(auto_now=True)),
|
|
(
|
|
"pgh_context",
|
|
models.ForeignKey(
|
|
db_constraint=False,
|
|
null=True,
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
related_name="+",
|
|
to="pghistory.context",
|
|
),
|
|
),
|
|
(
|
|
"pgh_obj",
|
|
models.ForeignKey(
|
|
db_constraint=False,
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
related_name="events",
|
|
to="email_service.emailconfiguration",
|
|
),
|
|
),
|
|
(
|
|
"site",
|
|
models.ForeignKey(
|
|
db_constraint=False,
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
related_name="+",
|
|
related_query_name="+",
|
|
to="sites.site",
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"abstract": False,
|
|
},
|
|
),
|
|
pgtrigger.migrations.AddTrigger(
|
|
model_name="emailconfiguration",
|
|
trigger=pgtrigger.compiler.Trigger(
|
|
name="insert_insert",
|
|
sql=pgtrigger.compiler.UpsertTriggerSql(
|
|
func='INSERT INTO "email_service_emailconfigurationevent" ("api_key", "created_at", "from_email", "from_name", "id", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "reply_to", "site_id", "updated_at") VALUES (NEW."api_key", NEW."created_at", NEW."from_email", NEW."from_name", NEW."id", _pgh_attach_context(), NOW(), \'insert\', NEW."id", NEW."reply_to", NEW."site_id", NEW."updated_at"); RETURN NULL;',
|
|
hash="[AWS-SECRET-REMOVED]",
|
|
operation="INSERT",
|
|
pgid="pgtrigger_insert_insert_08c59",
|
|
table="email_service_emailconfiguration",
|
|
when="AFTER",
|
|
),
|
|
),
|
|
),
|
|
pgtrigger.migrations.AddTrigger(
|
|
model_name="emailconfiguration",
|
|
trigger=pgtrigger.compiler.Trigger(
|
|
name="update_update",
|
|
sql=pgtrigger.compiler.UpsertTriggerSql(
|
|
condition="WHEN (OLD.* IS DISTINCT FROM NEW.*)",
|
|
func='INSERT INTO "email_service_emailconfigurationevent" ("api_key", "created_at", "from_email", "from_name", "id", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "reply_to", "site_id", "updated_at") VALUES (NEW."api_key", NEW."created_at", NEW."from_email", NEW."from_name", NEW."id", _pgh_attach_context(), NOW(), \'update\', NEW."id", NEW."reply_to", NEW."site_id", NEW."updated_at"); RETURN NULL;',
|
|
hash="[AWS-SECRET-REMOVED]",
|
|
operation="UPDATE",
|
|
pgid="pgtrigger_update_update_992a4",
|
|
table="email_service_emailconfiguration",
|
|
when="AFTER",
|
|
),
|
|
),
|
|
),
|
|
]
|