Skip to content

Commit

Permalink
fix(Tracker): errors linked to user_id
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Mar 29, 2024
1 parent 0adc957 commit e309d59
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lemarche/utils/tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ def track(page: str = "", action: str = "load", meta: dict = {}): # noqa B006
# Don't log in dev
if settings.BITOUBI_ENV not in ("dev", "test"):
date_created = timezone.now()
user_id = int(meta.get("user_id")) if meta.get("user_id", None) else None
user_id = meta.get("user_id", None)
if user_id:
user_id = int(user_id[0]) if (type(user_id) is list) else int(user_id)
user_kind = meta.get("user_kind") if meta.get("user_kind", "") else ""
siae_id = meta.get("siae_id", None)
if siae_id:
Expand Down

0 comments on commit e309d59

Please sign in to comment.