Add user filter to history tables

This commit is contained in:
Jonathan Wong 2015-09-07 19:23:08 -07:00
commit f1f1ed88a4
2 changed files with 3 additions and 1 deletions

View file

@ -60,7 +60,8 @@ class DataFactory(object):
'session_history.user',
'session_history_metadata.media_type',
'session_history_media_info.video_decision',
'session_history.user_id as user_id'
'session_history.user_id as user_id',
'users.show_user as show_user'
]
try:
query = data_tables.ssp_query(table_name='session_history',

View file

@ -596,6 +596,7 @@ class WebInterface(object):
if 'start_date' in kwargs:
start_date = kwargs.get('start_date', "")
custom_where = [['strftime("%Y-%m-%d", datetime(date, "unixepoch", "localtime"))', start_date]]
custom_where.append(['show_user', 1])
data_factory = datafactory.DataFactory()
history = data_factory.get_history(kwargs=kwargs, custom_where=custom_where)