-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #592 from MTES-MCT/staging
MEP v8.1.2
- Loading branch information
Showing
18 changed files
with
616 additions
and
454 deletions.
There are no files selected for viewing
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
133 changes: 133 additions & 0 deletions
133
project/migrations/0090_alter_historicalrequest_first_name_and_more.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,133 @@ | ||
# Generated by Django 4.2.13 on 2024-09-30 09:42 | ||
|
||
from django.db import migrations, models | ||
import utils.validators | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("project", "0089_rnupackagerequest"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="historicalrequest", | ||
name="first_name", | ||
field=models.CharField( | ||
max_length=150, null=True, validators=[utils.validators.is_alpha_validator], verbose_name="Prénom" | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="historicalrequest", | ||
name="function", | ||
field=models.CharField( | ||
max_length=250, null=True, validators=[utils.validators.is_alpha_validator], verbose_name="Fonction" | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="historicalrequest", | ||
name="last_name", | ||
field=models.CharField( | ||
max_length=150, null=True, validators=[utils.validators.is_alpha_validator], verbose_name="Nom" | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="historicalrequest", | ||
name="organism", | ||
field=models.CharField( | ||
choices=[ | ||
("AGENCE", "Agence d'urbanisme"), | ||
("ASSOCI", "Association"), | ||
("BUREAU", "Bureau d'études"), | ||
("COMMUN", "Commune"), | ||
("DDT", "DDT"), | ||
("DDTM", "DDTM"), | ||
("DEAL", "DEAL"), | ||
("DREAL", "DREAL"), | ||
("DRIEAT", "DRIEAT"), | ||
("EPCI", "EPCI"), | ||
("PARTIC", "Particulier"), | ||
("SCOT", "SCOT"), | ||
("AUTRE", "Autre"), | ||
], | ||
default="COMMUN", | ||
max_length=30, | ||
validators=[utils.validators.is_alpha_validator], | ||
verbose_name="Organisme", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="historicalrequest", | ||
name="requested_document", | ||
field=models.CharField( | ||
choices=[ | ||
("rapport-conso", "Rapport de consommation"), | ||
("rapport-complet", "Rapport complet"), | ||
("rapport-local", "Rapport local"), | ||
], | ||
max_length=30, | ||
validators=[utils.validators.is_alpha_validator], | ||
verbose_name="Document demandé", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="request", | ||
name="first_name", | ||
field=models.CharField( | ||
max_length=150, null=True, validators=[utils.validators.is_alpha_validator], verbose_name="Prénom" | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="request", | ||
name="function", | ||
field=models.CharField( | ||
max_length=250, null=True, validators=[utils.validators.is_alpha_validator], verbose_name="Fonction" | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="request", | ||
name="last_name", | ||
field=models.CharField( | ||
max_length=150, null=True, validators=[utils.validators.is_alpha_validator], verbose_name="Nom" | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="request", | ||
name="organism", | ||
field=models.CharField( | ||
choices=[ | ||
("AGENCE", "Agence d'urbanisme"), | ||
("ASSOCI", "Association"), | ||
("BUREAU", "Bureau d'études"), | ||
("COMMUN", "Commune"), | ||
("DDT", "DDT"), | ||
("DDTM", "DDTM"), | ||
("DEAL", "DEAL"), | ||
("DREAL", "DREAL"), | ||
("DRIEAT", "DRIEAT"), | ||
("EPCI", "EPCI"), | ||
("PARTIC", "Particulier"), | ||
("SCOT", "SCOT"), | ||
("AUTRE", "Autre"), | ||
], | ||
default="COMMUN", | ||
max_length=30, | ||
validators=[utils.validators.is_alpha_validator], | ||
verbose_name="Organisme", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="request", | ||
name="requested_document", | ||
field=models.CharField( | ||
choices=[ | ||
("rapport-conso", "Rapport de consommation"), | ||
("rapport-complet", "Rapport complet"), | ||
("rapport-local", "Rapport local"), | ||
], | ||
max_length=30, | ||
validators=[utils.validators.is_alpha_validator], | ||
verbose_name="Document demandé", | ||
), | ||
), | ||
] |
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,32 @@ | ||
# Generated by Django 4.2.13 on 2024-09-30 09:52 | ||
|
||
from django.db import migrations | ||
|
||
from utils.validators import is_alpha_valid | ||
|
||
|
||
def remove_invalid_user_inputs(apps, schema_editor): | ||
Request = apps.get_model("project", "Request") | ||
|
||
for request in Request.objects.all(): | ||
if not is_alpha_valid(request.first_name): | ||
request.first_name = "empty" | ||
if not is_alpha_valid(request.last_name): | ||
request.last_name = "empty" | ||
if not is_alpha_valid(request.function): | ||
request.function = "empty" | ||
if not is_alpha_valid(request.organism): | ||
request.organism = "COMMUN" | ||
if not is_alpha_valid(request.requested_document): | ||
request.requested_document = "rapport-complet" | ||
request.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("project", "0090_alter_historicalrequest_first_name_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(remove_invalid_user_inputs), | ||
] |
83 changes: 83 additions & 0 deletions
83
project/migrations/0092_remove_historicalproject_couverture_usage_and_more.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,83 @@ | ||
# Generated by Django 4.2.13 on 2024-10-01 09:14 | ||
|
||
from django.db import migrations, models | ||
import utils.validators | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("project", "0091_auto_20240930_1152"), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name="historicalproject", | ||
name="couverture_usage", | ||
), | ||
migrations.RemoveField( | ||
model_name="historicalproject", | ||
name="import_date", | ||
), | ||
migrations.RemoveField( | ||
model_name="historicalproject", | ||
name="import_error", | ||
), | ||
migrations.RemoveField( | ||
model_name="historicalproject", | ||
name="import_status", | ||
), | ||
migrations.RemoveField( | ||
model_name="project", | ||
name="couverture_usage", | ||
), | ||
migrations.RemoveField( | ||
model_name="project", | ||
name="import_date", | ||
), | ||
migrations.RemoveField( | ||
model_name="project", | ||
name="import_error", | ||
), | ||
migrations.RemoveField( | ||
model_name="project", | ||
name="import_status", | ||
), | ||
migrations.AlterField( | ||
model_name="historicalproject", | ||
name="name", | ||
field=models.CharField( | ||
max_length=100, validators=[utils.validators.is_alpha_validator], verbose_name="Nom" | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="historicalproject", | ||
name="territory_name", | ||
field=models.CharField( | ||
blank=True, | ||
help_text="C'est le nom qui est utilisé pour désigner votre territoire, notamment dans le rapport word.", | ||
max_length=250, | ||
null=True, | ||
validators=[utils.validators.is_alpha_validator], | ||
verbose_name="Territoire", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="project", | ||
name="name", | ||
field=models.CharField( | ||
max_length=100, validators=[utils.validators.is_alpha_validator], verbose_name="Nom" | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="project", | ||
name="territory_name", | ||
field=models.CharField( | ||
blank=True, | ||
help_text="C'est le nom qui est utilisé pour désigner votre territoire, notamment dans le rapport word.", | ||
max_length=250, | ||
null=True, | ||
validators=[utils.validators.is_alpha_validator], | ||
verbose_name="Territoire", | ||
), | ||
), | ||
] |
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
Oops, something went wrong.