Skip to content

Commit

Permalink
Enforce name uniqueness on club approval template names and fix appro…
Browse files Browse the repository at this point in the history
…val queue bulk submit button margins
  • Loading branch information
julianweng committed Oct 15, 2024
1 parent 4b30983 commit 950269f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -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),
),
]
2 changes: 1 addition & 1 deletion backend/clubs/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/Settings/QueueTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const QueueTableModal = ({
placeholder={`${isApproving ? 'approval' : 'rejection'} notes`}
></textarea>
<button
className={`mb-2 button ${isApproving ? 'is-success' : 'is-danger'}`}
className={`mt-2 button ${isApproving ? 'is-success' : 'is-danger'}`}
onClick={() => {
closeModal()
bulkAction(comment)
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/Settings/TemplatesTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default function TemplatesTab({
name="title"
as={TextField}
required
helpText={`The title of the ${OBJECT_NAME_SINGULAR} approval response template. This will be shown in the template dropdown menu.`}
helpText={`The unique title of the ${OBJECT_NAME_SINGULAR} approval response template. This will be shown in the template dropdown menu.`}
/>
<Field name="content" as={TextField} type="textarea" required />
</>
Expand Down

0 comments on commit 950269f

Please sign in to comment.