Skip to content

Commit

Permalink
cleaned up redirect functions for apps
Browse files Browse the repository at this point in the history
  • Loading branch information
ckrew committed Mar 14, 2024
1 parent cc66aab commit b105731
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion tests/unit_tests/test_tethys_apps/test_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def test_urls(self):
resolver = resolve(url)
self.assertEqual("/apps/", url)
self.assertEqual("RedirectView", resolver.func.__name__)
self.assertEqual("", resolver.func.view_initkwargs["url"])
self.assertEqual("home", resolver.func.view_initkwargs["pattern_name"])

url = reverse("send_beta_feedback")
resolver = resolve(url)
Expand Down
14 changes: 6 additions & 8 deletions tethys_apps/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,12 @@
url_namespaces = None
else:
standalone_app = get_configured_standalone_app()
urlpatterns.extend(
[
re_path(
r"^apps/",
RedirectView.as_view(url=""),
name="app_library",
)
]
urlpatterns.append(
re_path(
r"^apps/",
RedirectView.as_view(pattern_name="home"),
name="app_library",
)
)
url_namespaces = [standalone_app.url_namespace]

Expand Down

0 comments on commit b105731

Please sign in to comment.