d9a2399 Fix the error: 'Project' object has no attribute 'ci_hook'

Authored and Committed by pingou 7 years ago
    Fix the error: 'Project' object has no attribute 'ci_hook'
    
    Since 2.13.1, we were running into this error:
    AttributeError: 'Project' object has no attribute 'ci_hook'
    on a regular basis, when creating a new PR or when commenting on one, but
    not regular comment, just notification.
    In both of these situations, and on pagure.io that has the jenkins
    integration turned on, we notify the pagure-ci service that there was a
    change to the PR that should be tested.
    
    However, nowhere in the code did we load pagure.hooks.pagure_ci which
    contains the definition of the PagureCiTable having the backref from
    that table to Project and named it ``ci_hook``.
    This was working in 2.13 and not in 2.13.1 because in the commit:
    867097dc25bea470ed3d53cbd28c390e22d52b01
    We ran flake8 to clean the pagure.lib module and we removed that import.
    
    Simply bringing back this import and make it ignored of flake8 solves
    our problem.
    
    Fixes https://pagure.io/pagure/issue/2013
    
        
file modified
+4 -0