-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update FailedRunsNotificationCronJob to report more clearly
- Loading branch information
1 parent
518965a
commit c1e3614
Showing
6 changed files
with
266 additions
and
54 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
30 changes: 30 additions & 0 deletions
30
django_cron/migrations/0003_cronjoblog_failure_reported.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,30 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.10.3 on 2016-11-29 14:35 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
def set_old_logs_as_reported(apps, *args, **kwargs): | ||
CronJobLog = apps.get_model('django_cron', 'CronJobLog') | ||
CronJobLog.objects.update(failure_reported=True) | ||
|
||
|
||
def noop(*args, **kwargs): | ||
pass | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('django_cron', '0002_remove_max_length_from_CronJobLog_message'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='cronjoblog', | ||
name='failure_reported', | ||
field=models.BooleanField(default=False), | ||
), | ||
migrations.RunPython(set_old_logs_as_reported, reverse_code=noop) | ||
] |
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.