-
Notifications
You must be signed in to change notification settings - Fork 6
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 #227 from MTES-MCT/misc
Diverses améliorations mineures
- Loading branch information
Showing
32 changed files
with
778 additions
and
9,554 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
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
33 changes: 33 additions & 0 deletions
33
envergo/evaluations/migrations/0004_request_contact_emails_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,33 @@ | ||
# Generated by Django 4.2 on 2023-08-22 07:25 | ||
|
||
import django.contrib.postgres.fields | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("evaluations", "0003_rename_rr_mention_evaluation_rr_mention_html_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="request", | ||
name="contact_emails", | ||
field=django.contrib.postgres.fields.ArrayField( | ||
base_field=models.EmailField(max_length=254), | ||
blank=True, | ||
default=list, | ||
size=None, | ||
verbose_name="Contact e-mails", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="evaluation", | ||
name="rr_mention_md", | ||
field=models.TextField( | ||
blank=True, | ||
help_text="Will be included in the RR email. Only simple markdown (bold, italic, links, newlines).", | ||
verbose_name="Regulatory reminder mention", | ||
), | ||
), | ||
] |
24 changes: 24 additions & 0 deletions
24
envergo/evaluations/migrations/0005_evaluation_contact_emails.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,24 @@ | ||
# Generated by Django 4.2 on 2023-08-22 07:37 | ||
|
||
import django.contrib.postgres.fields | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("evaluations", "0004_request_contact_emails_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="evaluation", | ||
name="contact_emails", | ||
field=django.contrib.postgres.fields.ArrayField( | ||
base_field=models.EmailField(max_length=254), | ||
default=list, | ||
size=None, | ||
verbose_name="Contact e-mails", | ||
), | ||
preserve_default=False, | ||
), | ||
] |
25 changes: 25 additions & 0 deletions
25
envergo/evaluations/migrations/0006_set_contact_emails_values.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,25 @@ | ||
# Generated by Django 4.2 on 2023-08-22 07:40 | ||
|
||
from django.db import migrations | ||
|
||
|
||
def set_contact_emails(apps, schema_editor): | ||
Request = apps.get_model("evaluations", "Request") | ||
for request in Request.objects.all(): | ||
if request.contact_email: | ||
request.contact_emails = [request.contact_email] | ||
request.save() | ||
|
||
Evaluation = apps.get_model("evaluations", "Evaluation") | ||
for evaluation in Evaluation.objects.all(): | ||
if evaluation.contact_email: | ||
evaluation.contact_emails = [evaluation.contact_email] | ||
evaluation.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("evaluations", "0005_evaluation_contact_emails"), | ||
] | ||
|
||
operations = [migrations.RunPython(set_contact_emails)] |
20 changes: 20 additions & 0 deletions
20
envergo/evaluations/migrations/0007_remove_evaluation_contact_email_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,20 @@ | ||
# Generated by Django 4.2 on 2023-08-22 08:41 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("evaluations", "0006_set_contact_emails_values"), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name="evaluation", | ||
name="contact_email", | ||
), | ||
migrations.RemoveField( | ||
model_name="request", | ||
name="contact_email", | ||
), | ||
] |
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
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.