Skip to content

Commit

Permalink
reafctor(arch): cap puid length to 20
Browse files Browse the repository at this point in the history
  • Loading branch information
vEnhance committed Aug 8, 2023
1 parent b9ba0e1 commit 2217cf8
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
29 changes: 29 additions & 0 deletions arch/migrations/0032_alter_problem_puid.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Generated by Django 4.1.10 on 2023-08-08 01:44

import django.core.validators
from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("arch", "0031_vote_created_at_vote_updated_at"),
]

operations = [
migrations.AlterField(
model_name="problem",
name="puid",
field=models.CharField(
help_text="Problem identifier, as printed in OTIS. Capital letters and digits only.",
max_length=20,
unique=True,
validators=[
django.core.validators.RegexValidator(
message="Only uppercase letters and digits appear in PUID's.",
regex="^[A-Z0-9]+$",
)
],
verbose_name="PUID",
),
),
]
2 changes: 1 addition & 1 deletion arch/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def get_disk_statement_from_puid(puid: str) -> Optional[str]:
@reversion.register()
class Problem(models.Model):
puid = models.CharField(
max_length=24,
max_length=20,
help_text="Problem identifier, as printed in OTIS. Capital letters and digits only.",
unique=True,
verbose_name="PUID",
Expand Down

0 comments on commit 2217cf8

Please sign in to comment.