From 235976debe27854190c44a1ac575d3a143e900d5 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sat, 17 Aug 2024 01:52:57 +0200 Subject: [PATCH] Base app rejection on upstream URL --- rejectedlist.toml | 8 -------- store/app.py | 23 ++++++++++++----------- 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/rejectedlist.toml b/rejectedlist.toml index d9454ae1d0..31c87b4d61 100644 --- a/rejectedlist.toml +++ b/rejectedlist.toml @@ -104,13 +104,6 @@ upstream = "https://github.com/funmusicplace/mirlo/" website = "" reason = "Too big of a Docker-compose mess" -[opentalk] -name = "OpenTalk" -description = "Secure video conferencing for those who value productivity, digital sovereignty, and true data prote" -upstream = "https://gitlab.opencode.de/opentalk" -website = "https://opentalk.eu/en" -reason = "Licensing mess" - [h5p] name = "H5P" description = "This collection of tools aim to creates interactive exercices for learning purposes." @@ -174,7 +167,6 @@ upstream = "https://github.com/osclass/Osclass" website = "https://osclass-classifieds.com" reason = "Unmaintained" - [opentalk] name = "OpenTalk" description = "German developed, modern, conferencing tool running in browser alone." diff --git a/store/app.py b/store/app.py index 605db0a7c5..8d9ce413e7 100644 --- a/store/app.py +++ b/store/app.py @@ -370,17 +370,18 @@ def add_to_wishlist(): rejectedlist_rawtoml = rejectedlist_rawtoml.decoded_content.decode() rejectedlist = tomlkit.loads(rejectedlist_rawtoml) - if slug in rejectedlist: - return render_template( - "wishlist_add.html", - csrf_token=csrf_token, - successmsg=None, - errormsg=_( - "An entry with the name %(slug)s is listed among the rejected apps, with the following reason: %(reason)s", - slug=slug, - reason=rejectedlist[slug]["reason"], - ), - ) + for rejectedslug, rejectedinfo in rejectedlist.items(): + if upstream in rejectedinfo["upstream"]: + return render_template( + "wishlist_add.html", + csrf_token=csrf_token, + successmsg=None, + errormsg=_( + "This app's repository is listed among the already rejected apps, with the following reason:
%(reason)s", + slug=rejectedslug, + reason=rejectedinfo["reason"], + ), + ) app_catalog = get_catalog()["apps"]