a8e1a65 Fix activating and deactivating a hook (esp the ticket-hook)

Authored and Committed by pingou 5 years ago
    Fix activating and deactivating a hook (esp the ticket-hook)
    
    Previously the ticket-hook would raise a 404 error itself, making
    the code in the hook controller section by-passed and thus not allowing
    to rollback the session, practically practically rendering pagure stuck
    on a DB error (especially with RDBMS such as sqlite).
    With this commit, the ticket-hook now raises an exception that the
    controller catches and process as desired (rollback the DB session, raise
    the corresponding http error).
    This fix came with a few other changes found while debugging this issue,
    such as the session not being rollbacked for other exceptions.
    
    Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
    
        
file modified
+8 -6