From 950269f865ade03b3fe9af3325fd010d94d0b6d8 Mon Sep 17 00:00:00 2001 From: Julian Weng Date: Tue, 15 Oct 2024 19:42:39 -0400 Subject: [PATCH] Enforce name uniqueness on club approval template names and fix approval queue bulk submit button margins --- ...alter_clubapprovalresponsetemplate_title.py | 18 ++++++++++++++++++ backend/clubs/models.py | 2 +- frontend/components/Settings/QueueTab.tsx | 2 +- frontend/components/Settings/TemplatesTab.tsx | 2 +- 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 backend/clubs/migrations/0118_alter_clubapprovalresponsetemplate_title.py diff --git a/backend/clubs/migrations/0118_alter_clubapprovalresponsetemplate_title.py b/backend/clubs/migrations/0118_alter_clubapprovalresponsetemplate_title.py new file mode 100644 index 000000000..18f697da7 --- /dev/null +++ b/backend/clubs/migrations/0118_alter_clubapprovalresponsetemplate_title.py @@ -0,0 +1,18 @@ +# Generated by Django 5.0.4 on 2024-10-15 23:40 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("clubs", "0117_clubapprovalresponsetemplate"), + ] + + operations = [ + migrations.AlterField( + model_name="clubapprovalresponsetemplate", + name="title", + field=models.CharField(max_length=255, unique=True), + ), + ] diff --git a/backend/clubs/models.py b/backend/clubs/models.py index 4ff70142b..f4e57c96e 100644 --- a/backend/clubs/models.py +++ b/backend/clubs/models.py @@ -2007,7 +2007,7 @@ class ClubApprovalResponseTemplate(models.Model): author = models.ForeignKey( get_user_model(), on_delete=models.SET_NULL, null=True, related_name="templates" ) - title = models.CharField(max_length=255) + title = models.CharField(max_length=255, unique=True) content = models.TextField() created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True) diff --git a/frontend/components/Settings/QueueTab.tsx b/frontend/components/Settings/QueueTab.tsx index cbed7bef1..e8e7a7faf 100644 --- a/frontend/components/Settings/QueueTab.tsx +++ b/frontend/components/Settings/QueueTab.tsx @@ -94,7 +94,7 @@ const QueueTableModal = ({ placeholder={`${isApproving ? 'approval' : 'rejection'} notes`} >