diff --git a/openbook_auth/schema/queries.py b/openbook_auth/schema/queries.py index 75f204159b1e0de863ff481094f344b4351d2dec..d98930835a78b8027af722a1a3c6dd37b4deef56 100644 --- a/openbook_auth/schema/queries.py +++ b/openbook_auth/schema/queries.py @@ -8,7 +8,6 @@ import structlog from django.db.models import F, Q, Value from django.db.models.functions import Concat from django.db.models.lookups import IContains -from django.utils.translation import get_language_from_request from openbook_auth.models import User as UserModel, UserBlock as UserBlockModel from openbook_auth.schema.types import User, AuthenticatedUser @@ -16,7 +15,6 @@ from openbook_auth.utils import verify_authorized_user, check_max_limit from openbook_common.schema.types import Paged from openbook_common.validators import string_not_empty from openbook_insights.schema.types import Insight -from openbook_notifications.api import NotificationApi logger = structlog.get_logger(__name__) @@ -28,12 +26,6 @@ class Query: current_user = info.context.request.user if current_user.is_anonymous: return None - locale = get_language_from_request(info.context.request) - - # TODO: This is a hack to make sure that the subscriber is updated with the correct locale. - # Remove this when we add a language picker to the user profile. - NotificationApi.create_or_update_subscriber(user=current_user, locale=locale) - return current_user @strawberry_django.field() diff --git a/openbook_auth/tests/test_graphql.py b/openbook_auth/tests/test_graphql.py index 2972256172b6a9816e2420bfb29feaac67faea98..eb2875047538ad6a1b037e03e8c2a9f310480174 100644 --- a/openbook_auth/tests/test_graphql.py +++ b/openbook_auth/tests/test_graphql.py @@ -108,10 +108,6 @@ class TestUsers: assert authenticated_user["isEmployee"] == user.is_employee assert authenticated_user["connectionStatusToMyself"] is None - mock_create_or_update_subscriber.assert_called_once_with( - user=user, locale=mock_get_language_from_request.return_value - ) - def test_get_user_by_name_returns_only_matching_users_without_logged_in_user(self): user = make_user(name="Peter", last_name="Moser") user2 = make_user(name="Peter", last_name="Muster")