From b8fbf5bf484fe1767023875e87d01d8c47ca736d Mon Sep 17 00:00:00 2001 From: Evan Hanson Date: Sat, 4 Apr 2020 10:45:05 +1300 Subject: [PATCH] Remove commit filter when checking for duplicate artifact Artifacts are stored in a single flat namespace per repository, so the check for an existing artifact with the same name should not filter by commit, just username and repo. See git.sr.ht#272. --- gitsrht/repos.py | 1 - 1 file changed, 1 deletion(-) diff --git a/gitsrht/repos.py b/gitsrht/repos.py index 084386e..1bf7b40 100644 --- a/gitsrht/repos.py +++ b/gitsrht/repos.py @@ -42,7 +42,6 @@ def upload_artifact(valid, repo, commit, f, filename): artifact = (Artifact.query .filter(Artifact.user_id == repo.owner_id) .filter(Artifact.repo_id == repo.id) - .filter(Artifact.commit == commit) .filter(Artifact.filename == fn)).one_or_none() valid.expect(not artifact, "A file by this name was already uploaded.", field="file") -- 2.38.4