Verified Commit bdd55dba authored by Mattia Rizzolo's avatar Mattia Rizzolo

Merge branch 'email-on-admin-removal' of salsa.debian.org:lyknode-guest/debexpo into live

MR: !52Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mattia@debian.org>
parents 28f1c073 82afd275
Pipeline #42043 passed with stage
in 4 minutes and 27 seconds
......@@ -209,6 +209,19 @@ class PackageController(BaseController):
repo = Repository(config['debexpo.repository'])
repo.update()
# Send email on admin deletion
if session['user_id'] != package.user_id:
owner = meta.session.query(User).filter_by(id=package.user_id).one()
email = Email('upload_removed_from_expo')
email.send(
[owner.email],
package=package.name,
version='(all versions)',
reason='Removed by a debexpo administrator.\n\n'
'If you think this is an error, fell free to email '
'{}\n(Note that we cannot recover your package once '
'removed.)'.format(config['debexpo.email']))
redirect(url(controller='packages', action='my'))
@validate(schema=PackageCommentForm(), form='index')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment