mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 15:31:15 -05:00
Updates from review comments:
Update api_key relationship. Check that id in dict exists before deleting it
This commit is contained in:
@@ -7,7 +7,8 @@ from app.models import ApiKey
|
||||
|
||||
def save_model_api_key(api_key, update_dict={}):
|
||||
if update_dict:
|
||||
del update_dict['id']
|
||||
if update_dict['id']:
|
||||
del update_dict['id']
|
||||
db.session.query(ApiKey).filter_by(id=api_key.id).update(update_dict)
|
||||
else:
|
||||
api_key.secret = _generate_secret()
|
||||
|
||||
Reference in New Issue
Block a user