basically finish superuser key api
This commit is contained in:
parent
35ed73e195
commit
aaf9e83278
3 changed files with 34 additions and 25 deletions
|
@ -63,18 +63,22 @@ def get_service_keys(approved_only, kid=None, service=None):
|
|||
|
||||
query = ServiceKey.select()
|
||||
|
||||
if approved_only:
|
||||
query = query.where(~(ServiceKey.approval >> None))
|
||||
|
||||
if service is not None:
|
||||
query = query.where(ServiceKey.service == service)
|
||||
|
||||
if kid is not None:
|
||||
query.where(ServiceKey.kid == kid)
|
||||
|
||||
if approved_only:
|
||||
query = query.where(~(ServiceKey.approval >> None))
|
||||
|
||||
return query
|
||||
|
||||
|
||||
def get_service_key(kid):
|
||||
return get_service_keys(False, kid=kid).get()
|
||||
|
||||
|
||||
def delete_service_key(service, kid):
|
||||
_gc_expired(service)
|
||||
|
||||
|
|
Reference in a new issue