diff --git a/data/model.py b/data/model.py index 6c9d02ce6..50ef5892e 100644 --- a/data/model.py +++ b/data/model.py @@ -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,