Fixes https://pagure.io/pagure/issue/986 and https://pagure.io/pagure/issue/891 I think
rebased
+1
Pull-Request has been merged by pingou