fix: anonymous id as env var (#1106)

<!-- .github/pull_request_template.md -->

## Description
<!-- Provide a clear description of the changes in this PR -->

## DCO Affirmation
I affirm that all code in every commit of this pull request conforms to
the terms of the Topoteretes Developer Certificate of Origin.
This commit is contained in:
Boris 2025-07-18 17:56:08 +02:00 committed by vasilije
parent 3862f85da6
commit ade1d1ee65

View file

@ -54,6 +54,11 @@ def extract_pos_tags(sentence):
def get_anonymous_id():
"""Creates or reads a anonymous user id"""
tracking_id = os.getenv("TRACKING_ID", None)
if tracking_id:
return tracking_id
home_dir = str(pathlib.Path(pathlib.Path(__file__).parent.parent.parent.resolve()))
if not os.path.isdir(home_dir):