Skip to content

Commit

Permalink
improving signals logic
Browse files Browse the repository at this point in the history
  • Loading branch information
helrond committed Aug 26, 2019
1 parent d2f42e4 commit df6c9a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions aurora/bag_transfer/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def set_is_staff(sender, instance, **kwargs):
def update_dashboard_data(sender, instance, **kwargs):
today = date.today()
current = today - relativedelta(years=1)
if instance.process_status == sender.TRANSFER_COMPLETED:
if instance.process_status >= sender.TRANSFER_COMPLETED:
while current <= today:
for organization in Organization.objects.all():
data = DashboardMonthData.objects.get_or_create(
Expand All @@ -50,7 +50,7 @@ def update_dashboard_data(sender, instance, **kwargs):
machine_file_upload_time__month=current.month).values_list('machine_file_size', flat=True)))/1000000000
data.save()
current += relativedelta(months=1)
elif instance.process_status == sender.VALIDATED:
elif instance.process_status >= sender.VALIDATED:
for organization in Organization.objects.all():
for label in set(BagInfoMetadata.objects.all().values_list('record_type', flat=True)):
data = DashboardRecordTypeData.objects.get_or_create(
Expand Down

0 comments on commit df6c9a9

Please sign in to comment.