Skip to content

Commit

Permalink
24286 - Wrong link for "Review account" in staff notifications for ne…
Browse files Browse the repository at this point in the history
…w accoun… (#3159)
  • Loading branch information
sameer0422 authored Nov 29, 2024
1 parent 5d1d731 commit 32565c0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 3 additions & 2 deletions auth-api/src/auth_api/services/org.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from http import HTTPStatus
from typing import Dict, List, Tuple

from flask import current_app, g
from flask import current_app, g, request
from jinja2 import Environment, FileSystemLoader
from requests.exceptions import HTTPError
from sbc_common_components.utils.enums import QueueMessageTypes
Expand Down Expand Up @@ -926,7 +926,8 @@ def send_staff_review_account_reminder(relationship_id, task_relationship_type=T
task_relationship_type=task_relationship_type, relationship_id=relationship_id
)
context_path = f"review-account/{task.id}"
app_url = f"{g.get('origin_url', '')}/"
app_url = request.environ.get("HTTP_ORIGIN", "localhost")

review_url = f"{app_url}/{context_path}"
first_name = user.firstname
last_name = user.lastname
Expand Down
7 changes: 7 additions & 0 deletions auth-api/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ def app_request():
return _app


@pytest.fixture(scope="function", autouse=True)
def global_http_origin(app):
"""Set a global HTTP_ORIGIN for all tests."""
with app.test_request_context("/", environ_base={"HTTP_ORIGIN": "https://test.com"}):
yield


@pytest.fixture(scope="session")
def client(app): # pylint: disable=redefined-outer-name
"""Return a session-wide Flask test client."""
Expand Down

0 comments on commit 32565c0

Please sign in to comment.