Ticket #634: shortcut-fix.diff
File shortcut-fix.diff, 1.1 KB (added by , 19 years ago) |
---|
-
views/defaults.py
12 12 raise Http404, "Content type %s object %s doesn't exist" % (content_type_id, object_id) 13 13 if not hasattr(obj, 'get_absolute_url'): 14 14 raise Http404, "%s objects don't have get_absolute_url() methods" % content_type.name 15 absurl = obj.get_absolute_url() 16 if absurl.startswith('http://'): 17 return httpwrappers.HttpResponseRedirect(absurl) 15 18 object_domain = None 16 19 if hasattr(obj, 'get_site_list'): 17 20 site_list = obj.get_site_list() … … 27 30 except sites.SiteDoesNotExist: 28 31 pass 29 32 if not object_domain: 30 return httpwrappers.HttpResponseRedirect( obj.get_absolute_url())31 return httpwrappers.HttpResponseRedirect('http://%s%s' % (object_domain, obj.get_absolute_url()))33 return httpwrappers.HttpResponseRedirect(absurl) 34 return httpwrappers.HttpResponseRedirect('http://%s%s' % (object_domain, absurl)) 32 35 33 36 def page_not_found(request): 34 37 """