#1841 Fix editing tags of a project
Merged by pingou. Opened by pingou.
fix_edit_tags  into  master

Download 1841.patch

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

LGTM.

It might be good to add a test to assert that this stays fixed.

Yeah, I also want to do this, I'll add the tests before merging this.

Thanks for the review :)

:thumbsup:

1 new commit added

  • Add unit-tests to ensure editing tags of a project does not fail again

Unit-tests added :)

s/database it/database, and it/

LGTM!

1 new commit added

  • Improve the docstring with a better wording

rebased

Thanks for the review! :)

Pull-Request has been merged by pingou

Metadata