forked from City-of-Helsinki/smbackend
-
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.
Merge pull request #359 from City-of-Turku/bugfix/import-traffic-situ…
…ation-location-is-none Bugfix/import traffic situation location is none
- Loading branch information
Showing
6 changed files
with
486 additions
and
64 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
exceptional_situations/management/commands/delete_all_situations.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,19 @@ | ||
import logging | ||
|
||
from django.core.management import BaseCommand | ||
|
||
from exceptional_situations.models import ( | ||
Situation, | ||
SituationAnnouncement, | ||
SituationLocation, | ||
) | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
class Command(BaseCommand): | ||
def handle(self, *args, **options): | ||
SituationLocation.objects.all().delete() | ||
SituationAnnouncement.objects.all().delete() | ||
Situation.objects.all().delete() | ||
logger.info("Deleted all situations.") |
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.