service keys: delete notifications by prefix
This commit is contained in:
parent
fca258d8bf
commit
4020ab9f55
2 changed files with 2 additions and 2 deletions
|
@ -79,7 +79,7 @@ def list_notifications(user, kind_name=None, id_filter=None, include_dismissed=F
|
|||
def delete_all_notifications_by_path_prefix(prefix):
|
||||
(Notification
|
||||
.delete()
|
||||
.where(Notification.lookup_path % prefix)
|
||||
.where(Notification.lookup_path % prefix + '%')
|
||||
.execute())
|
||||
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ def _notify_superusers(key):
|
|||
superusers = User.select().where(User.username << config.app_config['SUPER_USERS'])
|
||||
for superuser in superusers:
|
||||
create_notification('service_key_submitted', superuser, metadata=notification_metadata,
|
||||
lookup_path='/service_key_approval/{0}'.format(key.kid))
|
||||
lookup_path='/service_key_approval/{0}/{1}'.format(key.kid, superuser.id))
|
||||
|
||||
|
||||
def create_service_key(name, kid, service, jwk, metadata, expiration_date):
|
||||
|
|
Reference in a new issue