Skip to content

Commit 78a0571

Browse files
committed
Don't modify 'home_namespace' globally
1 parent 1a28342 commit 78a0571

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

project_home_tags/templatetags/project_home.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ def home_url():
2222
2323
Returns None if PROJECT_HOME_NAMESPACE is not defined in settings.
2424
"""
25-
global home_namespace
2625
try:
2726
return reverse(home_namespace)
2827
except Exception:
28+
url = home_namespace
2929
try:
3030
validate_url = URLValidator()
31-
if '://' not in home_namespace:
32-
home_namespace = 'http://' + home_namespace
33-
validate_url(home_namespace)
34-
return(home_namespace)
31+
if '://' not in url:
32+
url = 'http://' + url
33+
validate_url(url)
34+
return(url)
3535
except ValidationError:
3636
return None
3737

0 commit comments

Comments
 (0)