Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions hypha/apply/users/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@
"/logout/",
"/account/",
"/apply/submissions/success/",
"/upload/upload/",
]

if settings.DEBUG:
TWO_FACTOR_EXEMPTED_PATH_PREFIXES.append("/__debug__/")


def get_page_path(wagtail_page):
_, _, page_path = wagtail_page.get_url_parts()
Expand Down
7 changes: 5 additions & 2 deletions hypha/apply/users/tests/test_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ def test_unverified_user_can_access_allowed_urls(self):
if "success" in path:
submission = ApplicationSubmissionFactory()
path = str(path) + f"{submission.id}/"
if "logout" in path:
response = self.client.get(path, follow=True)
elif "upload" in path:
response = self.client.post(path, HTTP_TUS_RESUMABLE=True)
elif "logout" in path:
response = self.client.post(path, follow=True)
else:
response = self.client.get(path, follow=True)
self.assertEqual(response.status_code, 200)
self.assertIn(response.status_code, [200, 201])