mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-05 03:38:12 +08:00
Merge #1285 Invalid scmurl on import should yield status 400
This commit is contained in:
@@ -397,7 +397,7 @@ class SCMHandler(BaseHandler):
|
||||
|
||||
if not get_scm_url_re().match(url):
|
||||
log.error("The submitted scmurl %r is not valid" % url)
|
||||
raise Forbidden("The submitted scmurl %s is not valid" % url)
|
||||
raise ValidationError("The submitted scmurl %s is not valid" % url)
|
||||
|
||||
if not skip_branch and "branch" not in self.data:
|
||||
log.error("Missing branch")
|
||||
|
||||
@@ -1155,8 +1155,8 @@ class TestViews:
|
||||
"The submitted scmurl https://src.stg.fedoraproject.org"
|
||||
"/modules/testmodule.git is not valid"
|
||||
)
|
||||
assert data["status"] == 403
|
||||
assert data["error"] == "Forbidden"
|
||||
assert data["status"] == 400
|
||||
assert data["error"] == "Bad Request"
|
||||
|
||||
@patch("module_build_service.auth.get_user", return_value=user)
|
||||
@patch("module_build_service.scm.SCM")
|
||||
@@ -1299,8 +1299,8 @@ class TestViews:
|
||||
"The submitted scmurl {} is not allowed".format(scmurl),
|
||||
"The submitted scmurl {} is not valid".format(scmurl),
|
||||
)
|
||||
assert data["status"] == 403
|
||||
assert data["error"] == "Forbidden"
|
||||
assert data["status"] in (400, 403)
|
||||
assert data["error"] in ("Bad Request", "Forbidden")
|
||||
|
||||
@patch("module_build_service.auth.get_user", return_value=user)
|
||||
@patch("module_build_service.scm.SCM")
|
||||
|
||||
Reference in New Issue
Block a user