Files

27 lines
1005 B
Python
Raw Permalink Normal View History

2020-04-16 00:11:05 +05:30
from stats.models import Submission
from buildhistory.models import BuildHistory
2020-04-23 23:45:36 +05:30
from port.models import LastPortIndexUpdate
2019-08-19 00:04:08 +05:30
def footer_processor(request):
response = dict()
try:
obj = LastPortIndexUpdate.objects.all().first()
port_info_updated_till_commit = obj.git_commit_hash
port_info_updated_at = obj.updated_at
response['port_info_updated_till_commit'] = port_info_updated_till_commit
response['port_info_updated_at'] = port_info_updated_at
except AttributeError:
pass
try:
latest_submission_made_at = Submission.objects.all().order_by('-timestamp').first().timestamp
response['latest_submission_made_at'] = latest_submission_made_at
except AttributeError:
pass
try:
latest_build_fetched_at = BuildHistory.objects.all().order_by('-time_start').first().time_start
response['latest_build_fetched_at'] = latest_build_fetched_at
except AttributeError:
pass
return response