mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-29 13:32:08 +00:00
test
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import os
|
||||
from typing import Dict
|
||||
|
||||
from pydantic.dataclasses import dataclass
|
||||
@@ -35,7 +36,8 @@ class ProfileModel(BaseModel):
|
||||
self.email = email
|
||||
self.username = self.email[: self.email.find("@")]
|
||||
self.remember = remember
|
||||
openbb_posthog.identify(self.uuid, {"email": self.email})
|
||||
if os.environ.get("OPENBB_LOG_COLLECT", "false").lower() == "true":
|
||||
openbb_posthog.identify(self.uuid, {"email": self.email})
|
||||
|
||||
def get_uuid(self) -> str:
|
||||
"""Get uuid.
|
||||
|
||||
@@ -145,13 +145,10 @@ class Backend(PyWry):
|
||||
"""Get the json update for the backend."""
|
||||
current_user = get_current_user()
|
||||
current_system = get_current_system()
|
||||
collect_logs = os.environ.get("OPENBB_LOG_COLLECT", "false").lower() == "true"
|
||||
|
||||
posthog: Dict[str, Any] = dict(collect_logs=current_system.LOG_COLLECT)
|
||||
if (
|
||||
current_system.LOG_COLLECT
|
||||
and current_user.profile.email
|
||||
and not self.logged_in
|
||||
):
|
||||
posthog: Dict[str, Any] = dict(collect_logs=collect_logs)
|
||||
if collect_logs and current_user.profile.email and not self.logged_in:
|
||||
self.logged_in = True
|
||||
posthog.update(
|
||||
dict(
|
||||
|
||||
@@ -5,6 +5,7 @@ __docformat__ = "numpy"
|
||||
import atexit
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import time
|
||||
@@ -261,7 +262,7 @@ def setup_handlers(settings: Settings):
|
||||
|
||||
if (
|
||||
not any([current_system.TEST_MODE, current_system.LOGGING_SUPPRESS])
|
||||
and current_system.LOG_COLLECT
|
||||
and os.environ.get("OPENBB_LOG_COLLECT", "false").lower() == "true"
|
||||
):
|
||||
add_posthog_handler(settings=settings)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user