Skip to content

Commit

Permalink
fix constraint for Logic hints
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonLovesDoggo committed Dec 6, 2023
1 parent 9a00b62 commit 080e467
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
25 changes: 25 additions & 0 deletions core/migrations/0020_alter_logicpuzzlehint_qr_index_and_more.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 4.1.13 on 2023-12-06 17:22

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("core", "0019_hunt_remove_team_is_active_remove_user_team_and_more"),
]

operations = [
migrations.AlterField(
model_name="logicpuzzlehint",
name="qr_index",
field=models.IntegerField(
help_text="The index of the QR code that this hint is for, that is everyone on their nth QR code will get same same hint (starting from 1)"
),
),
migrations.AddConstraint(
model_name="logicpuzzlehint",
constraint=models.UniqueConstraint(
fields=("qr_index", "hunt"), name="unique_qr_index_name_per_hunt"
),
),
]
1 change: 0 additions & 1 deletion core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,6 @@ class Meta:

@receiver(m2m_changed, sender=Team)
def remove_empty_teams(sender, instance: Team, action, **kwargs):
print(sender, instance, action, kwargs)
if action == "post_clear":
try:
instance.delete()
Expand Down

0 comments on commit 080e467

Please sign in to comment.