Revision 91ac2adc snf-quotaholder-app/quotaholder_django/quotaholder_app/views.py

b/snf-quotaholder-app/quotaholder_django/quotaholder_app/views.py
67 67
    if (appname, version) not in callpoints:
68 68
        return HttpResponse(status=404)
69 69

  
70
    if request.META['HTTP_X_AUTH_TOKEN'] != settings.QUOTAHOLDER_TOKEN:
70
    if request.META.get('HTTP_X_AUTH_TOKEN') != settings.QUOTAHOLDER_TOKEN:
71 71
        return HttpResponse(status=403, content='invalid token')
72 72

  
73 73
    callpoint = callpoints[(appname, version)]
......
76 76
        body = callpoint.make_call_from_json(callname, body)
77 77
        status = 200
78 78
    except Exception as e:
79
        logger.exception(e)
79 80
        status = 450
80 81
        if not isinstance(e, CallError):
81
            logger.exception(e)
82 82
            e.args += (''.join(format_exc()),)
83 83
            e = CallError.from_exception(e)
84 84
            status = 500

Also available in: Unified diff