Fix date time parameter on log_action to properly use the current time

This commit is contained in:
Joseph Schorr 2013-12-03 16:45:06 -05:00
parent 5b966ef254
commit c7ee3aaea1

View file

@ -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,