Ticket #9005: testfornone.diff
File testfornone.diff, 1.2 KB (added by , 16 years ago) |
---|
-
django/template/defaulttags.py
372 372 try: 373 373 url = reverse(self.view_name, args=args, kwargs=kwargs) 374 374 except NoReverseMatch: 375 project_name = settings.SETTINGS_MODULE.split('.')[0] 376 try: 377 url = reverse(project_name + '.' + self.view_name, 378 args=args, kwargs=kwargs) 379 except NoReverseMatch: 375 if settings.SETTINGS_MODULE is None: 376 # SETTINGS_MODULE is not set, so we can't guess the "main" app. 380 377 if self.asvar is None: 381 378 raise 379 else: 380 project_name = settings.SETTINGS_MODULE.split('.')[0] 381 try: 382 url = reverse(project_name + '.' + self.view_name, 383 args=args, kwargs=kwargs) 384 except NoReverseMatch: 385 if self.asvar is None: 386 raise 382 387 383 388 if self.asvar: 384 389 context[self.asvar] = url