Skip to content

Commit

Permalink
return None user_sync_dt value if no corresponding task
Browse files Browse the repository at this point in the history
  • Loading branch information
claire-peters committed Jun 29, 2023
1 parent 4b02a99 commit 6e0dd86
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions coldfront/core/allocation/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,10 @@ def get_context_data(self, **kwargs):

if 'django_q' in settings.INSTALLED_APPS:
# get last successful runs of djangoq task responsible for allocationuser data pull
user_sync_dt = Task.objects.filter(
user_sync_task = Task.objects.filter(
func__contains="pull_sf_push_cf_redash", success=True
).order_by('started').last().started
).order_by('started').last()
user_sync_dt = None if not user_sync_task else user_sync_task.started
else:
user_sync_dt = None
context['user_sync_dt'] = user_sync_dt
Expand Down
5 changes: 3 additions & 2 deletions coldfront/core/project/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,10 @@ def get_context_data(self, **kwargs):

if 'django_q' in settings.INSTALLED_APPS:
# get last successful runs of djangoq task responsible for projectuser data pull
user_sync_dt = Task.objects.filter(
user_sync_task = Task.objects.filter(
func__contains="update_group_membership_ldap", success=True
).order_by('started').last().started
).order_by('started').last()
user_sync_dt = None if not user_sync_task else user_sync_task.started
else:
user_sync_dt = None
context['user_sync_dt'] = user_sync_dt
Expand Down

0 comments on commit 6e0dd86

Please sign in to comment.