only send notifications when superusers enabled
This commit is contained in:
parent
b89d81d748
commit
2aa88dcb80
1 changed files with 5 additions and 4 deletions
|
@ -60,6 +60,7 @@ def _notify_superusers(key):
|
|||
if key.expiration_date is not None:
|
||||
notification_metadata['expiration_date'] = timegm(key.expiration_date.utctimetuple())
|
||||
|
||||
if len(config.app_config['SUPER_USERS']) > 0:
|
||||
superusers = User.select().where(User.username << config.app_config['SUPER_USERS'])
|
||||
for superuser in superusers:
|
||||
create_notification('service_key_submitted', superuser, metadata=notification_metadata,
|
||||
|
|
Reference in a new issue