[dist-git] Fix for api call token

There is a local fix on src.fedoraproject.org that is missing on
src.stg.fedoraproject.org. I provided the fix in
https://pagure.io/pagure/pull-request/5525 and this commit is adding it
as patch to ansible, so the change is permanent.
This commit is contained in:
Michal Konecny 2025-04-29 15:56:29 +02:00 committed by zlopez
parent a0046b5b4b
commit 5b0120cea9
2 changed files with 21 additions and 0 deletions

View file

@ -0,0 +1,12 @@
diff --git a/pagure/api/project.py b/pagure/api/project.py
index 80e0f22..02991fd 100644
--- a/pagure/api/project.py
+++ b/pagure/api/project.py
@@ -1449,6 +1449,7 @@ def api_new_project():
if (
pagure_config["PAGURE_AUTH"] == "oidc"
+ and hasattr(flask.g.fas_user, "can_create")
and flask.g.fas_user.can_create is False
):
raise pagure.exceptions.APIError(

View file

@ -55,6 +55,15 @@
tags:
- pagure
# https://pagure.io/pagure/pull-request/5525
- name: Fix the API call with token
ansible.posix.patch:
src: files/api_project.patch
dest: /usr/lib/python3.6/site-packages/pagure/api/project.py
tags:
- pagure
- hotfix
- name: Create the "git" user
ansible.builtin.command:
cmd: useradd --create-home --home-dir=/srv/git/ git