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:
parent
efec98f95b
commit
23eda1352f
1 changed files with 17 additions and 0 deletions
17
store/app.py
17
store/app.py
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue