Skip to content
This repository was archived by the owner on Apr 9, 2021. It is now read-only.

Commit 82016bb

Browse files
author
Jordan Caussat
committed
GHOST-625: Fix error on webhook creation with no app
1 parent 255306d commit 82016bb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,6 +1120,9 @@ def web_webhook_create():
11201120

11211121
# Set dynamic fields
11221122
apps = get_ghost_apps()
1123+
if not apps:
1124+
flash('You need at least 1 app to create a webhook', 'info')
1125+
return redirect(url_for('web_app_list'), code=301)
11231126
form.app_id.choices = [(app['_id'], "{name} ({id})".format(name=app['name'], id=app['_id'])) for app in apps]
11241127
form.module.choices = get_ghost_modules_names(apps[0]['_id'])
11251128
form.safe_deployment_strategy.choices = get_safe_deployment_possibilities(apps[0])

0 commit comments

Comments
 (0)