From ce14b9dddf62cc4101681808a859c094552b64ff Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Fri, 5 Aug 2016 16:37:04 -0400 Subject: [PATCH] modify log_action to internally resolve IDs --- data/model/log.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/data/model/log.py b/data/model/log.py index 6f2aeecc8..886610747 100644 --- a/data/model/log.py +++ b/data/model/log.py @@ -22,7 +22,7 @@ def _logs_query(selections, start_time, end_time, performer=None, repository=Non joined = joined.where(LogEntry.performer == performer) if namespace: - joined = joined.join(User).where(User.username == namespace) + joined = joined.join(User, on=(User.username == namespace)) if ignore: kind_map = get_log_entry_kinds() @@ -88,6 +88,12 @@ def log_action(kind_name, user_or_organization_name, performer=None, repository= if account is None: account = User.select(fn.Min(User.id)).tuples().get()[0] + if performer is not None: + performer = performer.id + + if repository is not None: + repository = repository.id + kind = _get_log_entry_kind(kind_name) metadata_json = json.dumps(metadata, default=_json_serialize) LogEntry.create(kind=kind, account=account, performer=performer,