Use Profile.metrics_fxa_id
This commit is contained in:
Родитель
9917706b0a
Коммит
89f20e80b6
|
@ -625,13 +625,9 @@ def _log_sms_exception(
|
|||
sms_exception: RelaySMSException,
|
||||
) -> None:
|
||||
"""Log SMS exceptions for incoming requests from the provider."""
|
||||
profile = real_phone.user.profile
|
||||
context = sms_exception.error_context()
|
||||
context["phone_provider"] = phone_provider
|
||||
if (fxa := profile.fxa) and profile.metrics_enabled:
|
||||
context["fxa_id"] = fxa.uid
|
||||
else:
|
||||
context["fxa_id"] = ""
|
||||
context["fxa_id"] = real_phone.user.profile.metrics_fxa_id
|
||||
info_logger.info(sms_exception.default_code, context)
|
||||
|
||||
|
||||
|
@ -792,11 +788,7 @@ def inbound_sms(request):
|
|||
# User has opted out with "STOP"
|
||||
# TODO: Mark RealPhone as unsubscribed?
|
||||
context = {"code": e.code, "http_status_code": e.status, "msg": e.msg}
|
||||
profile = real_phone.user.profile
|
||||
if (fxa := profile.fxa) and profile.metrics_enabled:
|
||||
context["fxa_id"] = fxa.uid
|
||||
else:
|
||||
context["fxa_id"] = ""
|
||||
context["fxa_id"] = real_phone.user.profile.metrics_fxa_id
|
||||
info_logger.info("User has blocked their Relay number", context)
|
||||
result = "BLOCKED"
|
||||
else:
|
||||
|
@ -1089,7 +1081,7 @@ def voice_status(request):
|
|||
info_logger.info(
|
||||
"phone_limit_exceeded",
|
||||
extra={
|
||||
"fxa_uid": relay_number.user.profile.fxa.uid,
|
||||
"fxa_uid": relay_number.user.profile.metrics_fxa_id,
|
||||
"call_duration_in_seconds": int(call_duration),
|
||||
"relay_number_enabled": relay_number.enabled,
|
||||
"remaining_seconds": relay_number.remaining_seconds,
|
||||
|
|
|
@ -73,7 +73,7 @@ class UserData(NamedTuple):
|
|||
if not metrics_enabled:
|
||||
return cls(metrics_enabled=False)
|
||||
|
||||
fxa_id = user.profile.fxa.uid if user.profile.fxa else None
|
||||
fxa_id = user.profile.metrics_fxa_id or None
|
||||
n_random_masks = user.relayaddress_set.count()
|
||||
n_domain_masks = user.domainaddress_set.count()
|
||||
n_deleted_random_masks = user.profile.num_deleted_relay_addresses
|
||||
|
|
|
@ -168,7 +168,7 @@ def create_expected_glean_event(
|
|||
|
||||
# Get values from the user object
|
||||
if user.profile.fxa:
|
||||
user_extra_items["fxa_id"] = user.profile.fxa.uid
|
||||
user_extra_items["fxa_id"] = user.profile.metrics_fxa_id
|
||||
user_extra_items["premium_status"] = user.profile.metrics_premium_status
|
||||
user_extra_items["date_joined_relay"] = str(int(user.date_joined.timestamp()))
|
||||
if user.profile.date_subscribed:
|
||||
|
|
Загрузка…
Ссылка в новой задаче