~rjarry/dlrepo

dlrepo: views: catch exception on invalid fmt name v1 APPLIED

Julien Floret: 1
 views: catch exception on invalid fmt name

 1 files changed, 1 insertions(+), 1 deletions(-)
#1446339 .build.yml success
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~rjarry/dlrepo/patches/57990/mbox | git am -3
Learn more about email & git

[PATCH dlrepo] views: catch exception on invalid fmt name Export this patch

Attempting to upload to a invalid format name (name starting with a
"." or containing a "/") resulted in error "500 Internal Server
Error". Let's catch the exception to get error "404: Not Found"
instead.

Signed-off-by: Julien Floret <julien.floret@6wind.com>
Acked-by: Thomas Faivre <thomas.faivre@6wind.com>
---
 dlrepo/views/artifact.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlrepo/views/artifact.py b/dlrepo/views/artifact.py
index dcd40ca992d2..e7dc1bcef067 100644
--- a/dlrepo/views/artifact.py
+++ b/dlrepo/views/artifact.py
@@ -50,9 +50,9 @@ class ArtifactView(BaseView):
                    .get_tag(match["tag"], access_cb)
                    .get_job(match["job"])
                )
                fmt = job.get_format(match["format"])
            except FileNotFoundError as e:
                raise web.HTTPNotFound() from e
            fmt = job.get_format(match["format"])
            if create:
                if match["format"] == "container":
                    agent = self.request.headers.get("User-Agent", "")
-- 
2.39.2
Julien Floret <julien.floret@6wind.com> wrote:
dlrepo/patches/.build.yml: SUCCESS in 56s

[views: catch exception on invalid fmt name][0] from [~jfloret][1]

[0]: https://lists.sr.ht/~rjarry/dlrepo/patches/57990
[1]: mailto:julien.floret@6wind.com

✓ #1446339 SUCCESS dlrepo/patches/.build.yml https://builds.sr.ht/~rjarry/job/1446339