Skip to content

Commit

Permalink
processors: fix bug in anonymize_user
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiaraBi authored and slint committed Jun 26, 2018
1 parent f4686f9 commit 9140e2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions invenio_stats/processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ def anonymize_user(doc):
pass

unique_session_id = hashlib.sha224()
if user_id is not None:
if user_id:
sid = '{}|{}'.format(user_id, timeslice)
unique_session_id.update(sid.encode('utf-8'))
elif session_id is not None:
elif session_id:
sid = '{}|{}'.format(session_id, timeslice)
unique_session_id.update(sid.encode('utf-8'))
elif ip and user_agent:
Expand Down

0 comments on commit 9140e2e

Please sign in to comment.