Add notification when release creation fails

This commit is contained in:
rubenwardy
2021-07-19 23:49:29 +01:00
parent f83605c35f
commit 2f77a84ec5
3 changed files with 9 additions and 2 deletions

View File

@@ -448,8 +448,12 @@ def edit_maintainers(package):
usernames = [x.strip().lower() for x in form.maintainers_str.data.split(",")]
users = User.query.filter(func.lower(User.username).in_(usernames)).all()
thread = package.threads.filter_by(author=get_system_user()).first()
for user in users:
if not user in package.maintainers:
if thread:
thread.watchers.append(user)
addNotification(user, current_user, NotificationType.MAINTAINER,
"Added you as a maintainer of {}".format(package.title), package.getDetailsURL(), package)