Put user last accessed updating behind a feature flag
This commit is contained in:
parent
a6b5b4d6e3
commit
4ba4d9141b
5 changed files with 22 additions and 4 deletions
|
@ -1,3 +1,5 @@
|
|||
import features
|
||||
|
||||
from app import avatar
|
||||
from data import model
|
||||
from data.database import User, FederatedLogin, Team as TeamTable, Repository, RobotAccountMetadata
|
||||
|
@ -25,7 +27,8 @@ class RobotPreOCIModel(RobotInterface):
|
|||
'name': robot_name,
|
||||
'token': robot_tuple.get(FederatedLogin.service_ident) if include_token else None,
|
||||
'created': robot_tuple.get(User.creation_date),
|
||||
'last_accessed': robot_tuple.get(User.last_accessed),
|
||||
'last_accessed': (robot_tuple.get(User.last_accessed)
|
||||
if features.USER_LAST_ACCESSED else None),
|
||||
'description': robot_tuple.get(RobotAccountMetadata.description),
|
||||
'unstructured_metadata': robot_tuple.get(RobotAccountMetadata.unstructured_json),
|
||||
}
|
||||
|
@ -58,7 +61,8 @@ class RobotPreOCIModel(RobotInterface):
|
|||
robot_dict['repositories'].append(repository_name)
|
||||
robots[robot_name] = RobotWithPermissions(robot_dict['name'], robot_dict['token'],
|
||||
robot_dict['created'],
|
||||
robot_dict['last_accessed'],
|
||||
(robot_dict['last_accessed']
|
||||
if features.USER_LAST_ACCESSED else None),
|
||||
robot_dict['teams'],
|
||||
robot_dict['repositories'],
|
||||
robot_dict['description'])
|
||||
|
|
Reference in a new issue