Make sure to switch the context back to LogEntry and make sure to only include the performer if actually present

This commit is contained in:
Joseph Schorr 2014-11-20 12:04:53 -05:00
parent cc7bccea4c
commit 8fab3b6d34
2 changed files with 3 additions and 2 deletions

View file

@ -2053,7 +2053,8 @@ def list_logs(start_time, end_time, performer=None, repository=None, namespace=N
.join(Performer, JOIN_LEFT_OUTER,
on=(LogEntry.performer == Performer.id).alias('performer'))
.switch(LogEntry)
.join(LogEntryKind))
.join(LogEntryKind)
.switch(LogEntry))
if repository:
joined = joined.where(LogEntry.repository == repository)

View file

@ -19,7 +19,7 @@ def log_view(log):
'datetime': format_date(log.datetime),
}
if log.performer:
if log.performer and log.performer.username:
view['performer'] = {
'kind': 'user',
'name': log.performer.username,