valaparthvi / pagure

Forked from pagure 7 years ago
Clone

4dc5c66 Fix editing tags of a project

Authored and Committed by pingou 7 years ago
    Fix editing tags of a project
    
    We had an issue where we were trying to find Tag object using a query
    that returned TagColored objects.
    Of course that didn't work.
    So when we were re-adding an existing tag to a new project, the logic was
    trying to create a Tag object that already existed. That resulted in an
    IntegrityError due to failing the unique constraint.
    
    This commit fixes this by creating a new get_colored_tag that will
    searched if a TagColored exists and adjust get_tag to search if a Tag
    exists, making the workflow work.
    
    Fixes https://pagure.io/pagure/issue/1818
    
        
file modified
+19 -11
file modified
+1 -1