mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-06-12 17:32:47 -04:00
fix flake 8
This commit is contained in:
@@ -555,15 +555,12 @@ def get_tuples_of_financial_years(
|
||||
|
||||
|
||||
def set_timezone():
|
||||
# This is set in dashboard.html on page load
|
||||
print(hilite("INVOKING set_timezone()!!!!"))
|
||||
# Cookie is set in dashboard.html on page load
|
||||
try:
|
||||
timezone = request.cookies.get("timezone", "US/Eastern")
|
||||
current_app.logger.debug(hilite(f"User's timezone is {timezone}"))
|
||||
serialized_user = current_user.serialize()
|
||||
if serialized_user["preferred_timezone"] is not timezone:
|
||||
current_user.update(preferred_timezone=timezone)
|
||||
except RuntimeError as e:
|
||||
current_app.logger.exception(hilite(f"Can't get timezone, running tests?"))
|
||||
except Exception as e:
|
||||
current_app.logger.exception(hilite(f"Can't get timezone, running tests?"))
|
||||
except Exception:
|
||||
current_app.logger.exception(hilite("Can't get timezone"))
|
||||
|
||||
@@ -1757,13 +1757,11 @@ def test_org_breadcrumbs_show_if_user_is_platform_admin(
|
||||
platform_admin_user,
|
||||
client_request,
|
||||
):
|
||||
print("ENTER TESET")
|
||||
service_one_json = service_json(
|
||||
SERVICE_ONE_ID,
|
||||
users=[platform_admin_user["id"]],
|
||||
organization_id=ORGANISATION_ID,
|
||||
)
|
||||
print("GOT SERVICE ONE")
|
||||
|
||||
mocker.patch(
|
||||
"app.service_api_client.get_service", return_value={"data": service_one_json}
|
||||
@@ -1785,14 +1783,9 @@ def test_org_breadcrumbs_show_if_user_is_platform_admin(
|
||||
"app.main.views.dashboard.get_daily_stats_by_user",
|
||||
return_value=mock_daily_stats_by_user,
|
||||
)
|
||||
print("DID ALL PATCHES")
|
||||
|
||||
client_request.login(platform_admin_user, service_one_json)
|
||||
print("LOGGED IN")
|
||||
page = client_request.get("main.service_dashboard", service_id=SERVICE_ONE_ID)
|
||||
print("HERE IS THE PAGE")
|
||||
print(page)
|
||||
print("XXXXXXXXXXXXXXXXX")
|
||||
assert page.select_one(".navigation-organization-link")["href"] == url_for(
|
||||
"main.organization_dashboard",
|
||||
org_id=ORGANISATION_ID,
|
||||
|
||||
Reference in New Issue
Block a user