File tree Expand file tree Collapse file tree 5 files changed +19
-4
lines changed
project_home_tags/templatetags Expand file tree Collapse file tree 5 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 11[bumpversion]
2- current_version = 0.1 .0
2+ current_version = 0.2 .0
33parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-dev(?P<dev>\d+))?
44serialize =
55 {major}.{minor}.{patch}-dev{dev}
Original file line number Diff line number Diff line change 11Revision History
22================
33
4+ 0.2.0 2018-12-08
5+
6+ - Allow `settings.PROJECT_HOME_NAMESPACE ` to be an actual URL, rather than just an internal namespace
7+
8+
490.1.0 2018-11-20
510
611- A collection of Django templatetags to flexibly incorporate links and breadcrumbs from app pages to the homepage of a project
Original file line number Diff line number Diff line change @@ -144,4 +144,4 @@ If ``settings.PROJECT_HOME_NAMESPACE`` is defined as ``'project_name:index_view'
144144 < / ol>
145145
146146
147- * Version 0.1 .0*
147+ * Version 0.2 .0*
Original file line number Diff line number Diff line change 33from django import template
44from django import VERSION as DJANGO_VERSION
55from django .conf import settings
6+ from django .core .exceptions import ValidationError
7+ from django .core .validators import URLValidator
68from django .utils .html import format_html
79
810if DJANGO_VERSION < (1 , 10 ):
@@ -20,10 +22,18 @@ def home_url():
2022
2123 Returns None if PROJECT_HOME_NAMESPACE is not defined in settings.
2224 """
25+ global home_namespace
2326 try :
2427 return reverse (home_namespace )
2528 except Exception :
26- return None
29+ try :
30+ validate_url = URLValidator ()
31+ if '://' not in home_namespace :
32+ home_namespace = 'http://' + home_namespace
33+ validate_url (home_namespace )
34+ return (home_namespace )
35+ except ValidationError :
36+ return None
2737
2838
2939def silence_without_namespace (f ):
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ def read(*paths):
2424
2525setup (
2626 name = 'django-project-home-templatetags' ,
27- version = '0.1 .0' ,
27+ version = '0.2 .0' ,
2828 packages = ['project_home_tags' ],
2929 include_package_data = True ,
3030 license = 'BSD License' ,
You can’t perform that action at this time.
0 commit comments