-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Dépôt de besoin] Nouveau status "SENT" (#997)
* New Tender.status option SENT * Add to admin * On tender validate, also set sent_at * New Tender.sent() qs * Fix tests & rebase
- Loading branch information
Showing
22 changed files
with
160 additions
and
70 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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Generated by Django 4.2.2 on 2023-11-30 22:12 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
def populate_tenders_sent_status(apps, schema_editor): | ||
Tender = apps.get_model("tenders", "Tender") | ||
|
||
for tender in Tender.objects.filter(validated_at__isnull=False): | ||
tender.sent_at = tender.validated_at | ||
tender.status = "SENT" | ||
tender.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("tenders", "0063_tender_distance_location"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="tender", | ||
name="sent_at", | ||
field=models.DateTimeField(blank=True, null=True, verbose_name="Date d'envoi"), | ||
), | ||
migrations.AlterField( | ||
model_name="tender", | ||
name="status", | ||
field=models.CharField( | ||
choices=[("DRAFT", "Brouillon"), ("PUBLISHED", "Publié"), ("VALIDATED", "Validé"), ("SENT", "Envoyé")], | ||
default="DRAFT", | ||
max_length=10, | ||
verbose_name="Statut", | ||
), | ||
), | ||
migrations.RunPython(populate_tenders_sent_status), | ||
] |
Oops, something went wrong.