##// END OF EJS Templates
auth-token: only delete token if it exists.
marcink -
r1839:b52a5a91 default
parent child Browse files
Show More
@@ -71,11 +71,13 b' class AuthTokenModel(BaseModel):'
71 user = self._get_user(user)
71 user = self._get_user(user)
72 auth_token = auth_token.filter(UserApiKeys.user_id == user.user_id)
72 auth_token = auth_token.filter(UserApiKeys.user_id == user.user_id)
73 auth_token = auth_token.scalar()
73 auth_token = auth_token.scalar()
74 try:
74
75 Session().delete(auth_token)
75 if auth_token:
76 except Exception:
76 try:
77 log.error(traceback.format_exc())
77 Session().delete(auth_token)
78 raise
78 except Exception:
79 log.error(traceback.format_exc())
80 raise
79
81
80 def get_auth_tokens(self, user, show_expired=True):
82 def get_auth_tokens(self, user, show_expired=True):
81 user = self._get_user(user)
83 user = self._get_user(user)
General Comments 0
You need to be logged in to leave comments. Login now