from olcc.models import ImportRecord

"""
Inject the last import date into the request context.
"""
def last_updated(request):
    record = ImportRecord.objects.latest()
    if record:
        return {
            'last_updated': record.created_at
        }

from olcc.models import ImportRecord

"""
Inject the last import date into the request context.
"""
def last_updated(request):
    try:
        return {
            'last_updated': ImportRecord.objects.latest().created_at
        }
    except ImportRecord.DoesNotExist:
        pass

Fix a DoesNotExist bug in the olcc context processor.
Fix a DoesNotExist bug in the olcc context processor.
