jkaluza / freshmaker

Forked from freshmaker 7 years ago
Clone

0c11b0e Use werkzeug.exceptions.Unauthorized instead

Authored and Committed by cqi 5 years ago
    Use werkzeug.exceptions.Unauthorized instead
    
    Without this change, test
    TestOpenIDCLogin.test_openidc_manual_trigger_unauthorized fails due to
    flask responses 500 internal server error rather than 401 unauthorized.
    
    It happens because freshmaker defines its own Unauthorized exception and
    register a handler for it. However, when user is not authenticated and
    abort is called, flask searches an error handler internally by
    werkzeug.exception.Unauthorized. As a result, no asscoiated handler is
    found and handler of internal server error is returned finally.
    
    To fix this issue, this patch uses werkzeug's Unauthorized instead and
    tests are updated accordingly.
    
    Signed-off-by: Chenxiong Qi <cqi@redhat.com>
    
        
file modified
+2 -1
file modified
+2 -5
file modified
+4 -4