| |
@@ -1340,9 +1340,12 @@
|
| |
"""
|
| |
|
| |
repo = _get_repo(repo, username, namespace)
|
| |
- _check_pull_request(repo)
|
| |
- _check_token(repo)
|
| |
+ parent = repo
|
| |
+ if repo.parent:
|
| |
+ parent = repo.parent
|
| |
|
| |
+ _check_pull_request(parent)
|
| |
+ _check_token(repo)
|
| |
form = pagure.forms.RequestPullForm(csrf_enabled=False)
|
| |
if not form.validate_on_submit():
|
| |
raise pagure.exceptions.APIError(
|
| |
@@ -1363,10 +1366,6 @@
|
| |
errors={"branch_from": ["This field is required."]},
|
| |
)
|
| |
|
| |
- parent = repo
|
| |
- if repo.parent:
|
| |
- parent = repo.parent
|
| |
-
|
| |
if not parent.settings.get("pull_requests", True):
|
| |
raise pagure.exceptions.APIError(
|
| |
404, error_code=APIERROR.EPULLREQUESTSDISABLED
|
| |
The detection of parent repo in api_pull_request_create was broken - was trying to open pull request on fork.
Now the pull request is opened on the parent.
Fixes #4416
Signed-off-by: Lenka Segura lenka@sepu.cz