~edwargix/git.sr.ht

b8fbf5bf484fe1767023875e87d01d8c47ca736d — Evan Hanson 5 years ago e93c6d0
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.
1 files changed, 0 insertions(+), 1 deletions(-)

M gitsrht/repos.py
M gitsrht/repos.py => gitsrht/repos.py +0 -1
@@ 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")