Ejemplo n.º 1
0
def get_maintenance():
    """Get the current start and end times for the maintenance state.
    Return None if there is no current maintenance state.
    """
    maintenance = MaintenanceState.objects.all().first()
    return MaintenanceStateSerializer(
        maintenance).data if maintenance else None
Ejemplo n.º 2
0
def status_check(request, format=None, **kwargs):
    maintenance = MaintenanceState.objects.all().first()
    return Response({
        'maintenance':
        MaintenanceStateSerializer(maintenance).data if maintenance else None
    })