Fix GitLab webhook repo not matching with capital letters
This commit is contained in:
@@ -20,6 +20,7 @@ from app.models import Package, APIToken, Permission, PackageState
|
||||
|
||||
|
||||
def get_packages_for_vcs_and_token(token: APIToken, repo_url: str) -> list[Package]:
|
||||
repo_url = repo_url.replace("https://", "").replace("http://", "").lower()
|
||||
if token.package:
|
||||
packages = [token.package]
|
||||
if not token.package.check_perm(token.owner, Permission.APPROVE_RELEASE):
|
||||
|
||||
@@ -38,7 +38,7 @@ def webhook_impl():
|
||||
if token is None:
|
||||
return error(403, "Invalid authentication")
|
||||
|
||||
packages = get_packages_for_vcs_and_token(token, json["project"]["web_url"].replace("https://", "").replace("http://", ""))
|
||||
packages = get_packages_for_vcs_and_token(token, json["project"]["web_url"])
|
||||
for package in packages:
|
||||
#
|
||||
# Check event
|
||||
|
||||
Reference in New Issue
Block a user