'If the user has not created an API request, redirect them to the
request form. Otherwise, display the status of their API
request. We take `form` as an optional argument so that we can
display validation errors correctly on the page.'

def get(self, request, form=None):

    if (form is None):
        form = self.get_form_class()()
    user = request.user
    try:
        api_request = ApiAccessRequest.objects.get(user=user)
    except ApiAccessRequest.DoesNotExist:
        return redirect(reverse('api_admin:api-request'))
    try:
        application = Application.objects.get(user=user)
    except Application.DoesNotExist:
        application = None
    for field in ('client_type', 'client_secret', 'client_id', 'authorization_grant_type'):
        form.fields.pop(field)
    return render_to_response('api_admin/status.html', {'status': api_request.status, 'api_support_link': settings.API_DOCUMENTATION_URL, 'api_support_email': settings.API_ACCESS_MANAGER_EMAIL, 'form': form, 'application': application})
