Removed julian/tests.py and julian/views.py. Switched Location handling from a settin...
[philo.git] / models / nodes.py
index a89d653..10c51b4 100644 (file)
@@ -3,6 +3,7 @@ from django.contrib.contenttypes.models import ContentType
 from django.contrib.contenttypes import generic
 from django.contrib.sites.models import Site, RequestSite
 from django.http import HttpResponse, HttpResponseServerError, HttpResponseRedirect, Http404
 from django.contrib.contenttypes import generic
 from django.contrib.sites.models import Site, RequestSite
 from django.http import HttpResponse, HttpResponseServerError, HttpResponseRedirect, Http404
+from django.core.exceptions import ValidationError
 from django.core.servers.basehttp import FileWrapper
 from django.core.urlresolvers import resolve, clear_url_caches, reverse, NoReverseMatch
 from django.template import add_to_builtins as register_templatetags
 from django.core.servers.basehttp import FileWrapper
 from django.core.urlresolvers import resolve, clear_url_caches, reverse, NoReverseMatch
 from django.template import add_to_builtins as register_templatetags
@@ -73,7 +74,7 @@ class Node(TreeEntity):
                else:
                        domain = ""
                
                else:
                        domain = ""
                
-               if not path:
+               if not path or subpath == "/":
                        subpath = subpath[1:]
                
                return '%s%s%s%s' % (domain, root_url, path, subpath)
                        subpath = subpath[1:]
                
                return '%s%s%s%s' % (domain, root_url, path, subpath)
@@ -233,7 +234,7 @@ class TargetURLModel(models.Model):
                node = self.target_node
                if node is not None and node.accepts_subpath and self.url_or_subpath:
                        if self.reversing_parameters is not None:
                node = self.target_node
                if node is not None and node.accepts_subpath and self.url_or_subpath:
                        if self.reversing_parameters is not None:
-                               view_name, args, kwargs = self.get_reversing_params()
+                               view_name, args, kwargs = self.get_reverse_params()
                                subpath = node.view.reverse(view_name, args=args, kwargs=kwargs)
                        else:
                                subpath = self.url_or_subpath
                                subpath = node.view.reverse(view_name, args=args, kwargs=kwargs)
                        else:
                                subpath = self.url_or_subpath
@@ -244,7 +245,7 @@ class TargetURLModel(models.Model):
                        return node.get_absolute_url()
                else:
                        if self.reversing_parameters is not None:
                        return node.get_absolute_url()
                else:
                        if self.reversing_parameters is not None:
-                               view_name, args, kwargs = self.get_reversing_params()
+                               view_name, args, kwargs = self.get_reverse_params()
                                return reverse(view_name, args=args, kwargs=kwargs)
                        return self.url_or_subpath
        target_url = property(get_target_url)
                                return reverse(view_name, args=args, kwargs=kwargs)
                        return self.url_or_subpath
        target_url = property(get_target_url)