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,10 +60,11 @@ def _notify_superusers(key):
|
||||||
if key.expiration_date is not None:
|
if key.expiration_date is not None:
|
||||||
notification_metadata['expiration_date'] = timegm(key.expiration_date.utctimetuple())
|
notification_metadata['expiration_date'] = timegm(key.expiration_date.utctimetuple())
|
||||||
|
|
||||||
superusers = User.select().where(User.username << config.app_config['SUPER_USERS'])
|
if len(config.app_config['SUPER_USERS']) > 0:
|
||||||
for superuser in superusers:
|
superusers = User.select().where(User.username << config.app_config['SUPER_USERS'])
|
||||||
create_notification('service_key_submitted', superuser, metadata=notification_metadata,
|
for superuser in superusers:
|
||||||
lookup_path='/service_key_approval/{0}/{1}'.format(key.kid, superuser.id))
|
create_notification('service_key_submitted', superuser, metadata=notification_metadata,
|
||||||
|
lookup_path='/service_key_approval/{0}/{1}'.format(key.kid, superuser.id))
|
||||||
|
|
||||||
|
|
||||||
def create_service_key(name, kid, service, jwk, metadata, expiration_date, rotation_duration=None):
|
def create_service_key(name, kid, service, jwk, metadata, expiration_date, rotation_duration=None):
|
||||||
|
|
Reference in a new issue