Skip to content

Commit

Permalink
Fix choices
Browse files Browse the repository at this point in the history
  • Loading branch information
AndersSeverinsen committed Oct 17, 2024
1 parent 42fb291 commit 6d1b8ca
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 94 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Generated by Django 4.2 on 2024-10-17 23:44

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("bartenders", "0003_auto_20240915_2045"),
]

operations = [
migrations.AlterField(
model_name="bartender",
name="email",
field=models.EmailField(
blank=True,
help_text="En post.au mail fungerer ikke",
max_length=254,
unique=True,
verbose_name="E-mail",
),
),
migrations.AlterField(
model_name="bartender",
name="tshirt_size",
field=models.CharField(
blank=True,
choices=[
("XS", "XS"),
("S", "S"),
("M", "M"),
("L", "L"),
("XL", "XL"),
("XXL", "XXL"),
("XXXL", "XXXL"),
],
max_length=140,
null=True,
verbose_name="T-shirt størrelse",
),
),
migrations.AlterField(
model_name="bartenderapplication",
name="email",
field=models.EmailField(
blank=True,
help_text="En post.au mail fungerer ikke",
max_length=254,
unique=True,
verbose_name="E-mail",
),
),
migrations.AlterField(
model_name="bartenderapplication",
name="tshirt_size",
field=models.CharField(
blank=True,
choices=[
("XS", "XS"),
("S", "S"),
("M", "M"),
("L", "L"),
("XL", "XL"),
("XXL", "XXL"),
("XXXL", "XXXL"),
],
max_length=140,
null=True,
verbose_name="T-shirt størrelse",
),
),
]
49 changes: 0 additions & 49 deletions bartenders/migrations/0004_alter_bartender_tshirt_size_and_more.py

This file was deleted.

35 changes: 0 additions & 35 deletions bartenders/migrations/0005_alter_bartender_email_and_more.py

This file was deleted.

17 changes: 9 additions & 8 deletions bartenders/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ def date_format(dt, format):
# but we enforce that in BartenderApplicationForm for new applications.
class BartenderCommon(models.Model):
TSHIRT_SIZE_CHOICES = (
(0, "XS"),
(1, "S"),
(2, "M"),
(3, "L"),
(4, "XL"),
(5, "XXL"),
(6, "XXXL"),
("XS", "XS"),
("S", "S"),
("M", "M"),
("L", "L"),
("XL", "XL"),
("XXL", "XXL"),
("XXXL", "XXXL"),
)

class Meta:
Expand All @@ -65,7 +65,8 @@ class Meta:
phoneNumber = models.IntegerField(
blank=True, null=True, verbose_name=_("Telefonnummer")
)
tshirt_size = models.IntegerField(
tshirt_size = models.CharField(
max_length=140,
choices=TSHIRT_SIZE_CHOICES,
blank=True,
null=True,
Expand Down
4 changes: 2 additions & 2 deletions bartenders/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def test_accepting_application(self):
phoneNumber=42345123,
)
ap = BartenderApplication.objects.create(
**d, tshirt_size=2, study="Datalogi", study_year=1
**d, tshirt_size="L", study="Datalogi", study_year=1
)
ap.accept()

Expand Down Expand Up @@ -66,7 +66,7 @@ def test_sending_application(self):
email="[email protected]",
studentNumber=123123,
phoneNumber=12312312,
tshirt_size=2,
tshirt_size="L",
study="Datalogi",
study_year=1,
info="Hkll",
Expand Down

0 comments on commit 6d1b8ca

Please sign in to comment.