-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Empêcher la création d'un objectif ayant pour slug 'non-classes'
Ce slug est utilisé pour afficher les contenus qui n'ont aucun objectif attribué.
- Loading branch information
1 parent
3460554
commit 1480410
Showing
3 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
zds/tutorialv2/migrations/0038_goals_forbid_unclassified_slug.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Generated by Django 3.2.19 on 2023-06-18 11:36 | ||
|
||
import django.core.validators | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("tutorialv2", "0037_labels"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="goal", | ||
name="slug", | ||
field=models.SlugField( | ||
max_length=80, | ||
unique=True, | ||
validators=[ | ||
django.core.validators.RegexValidator( | ||
"^non-classes$", inverse_match=True, message="Ce slug est réservé." | ||
) | ||
], | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters