1
0
Fork 0
mirror of https://github.com/YunoHost/apps.git synced 2024-09-03 20:06:07 +02:00

store: show error if the app is already in the catalog on wishlist submission

This commit is contained in:
OniriCorpe 2024-03-22 04:47:57 +01:00 committed by Bram
parent efec98f95b
commit 23eda1352f

View file

@ -348,6 +348,23 @@ def add_to_wishlist():
),
)
app_catalog = get_catalog()["apps"]
if slug in app_catalog:
url = f"https://apps.yunohost.org/app/{slug}"
return render_template(
"wishlist_add.html",
locale=get_locale(),
user=session.get("user", {}),
csrf_token=csrf_token,
successmsg=None,
errormsg=_(
"An app with the name %(slug)s already exists in the catalog, <a href='%(url)s'>you can see its page here</a>.",
slug=slug,
url=url,
),
)
new_wishlist[slug] = {
"name": name,
"description": description,