Fix date time parameter on log_action to properly use the current time
This commit is contained in:
parent
5b966ef254
commit
c7ee3aaea1
1 changed files with 4 additions and 1 deletions
|
@ -1067,7 +1067,10 @@ def list_logs(user_or_organization_name, repository = None):
|
|||
return joined.where(User.username == user_or_organization_name, LogEntry.datetime >= week_ago).order_by(LogEntry.datetime.desc())
|
||||
|
||||
def log_action(kind_name, user_or_organization_name, performer=None, repository=None,
|
||||
access_token=None, ip=None, metadata={}, datetime=datetime.today()):
|
||||
access_token=None, ip=None, metadata={}, datetime=None):
|
||||
if not datetime:
|
||||
datetime = datetime.today()
|
||||
|
||||
kind = LogEntryKind.get(LogEntryKind.name == kind_name)
|
||||
account = User.get(User.username == user_or_organization_name)
|
||||
entry = LogEntry.create(kind=kind, account=account, performer=performer,
|
||||
|
|
Reference in a new issue