Ticket #14450: sites.py.patch
File sites.py.patch, 2.1 KB (added by , 14 years ago) |
---|
-
sites.py
old new 370 370 if app_label in app_dict: 371 371 app_dict[app_label]['models'].append(model_dict) 372 372 else: 373 app_name = app_label.title() 374 try: 375 app_name = settings.APP_NAMES[app_label] 376 except: 377 pass 373 378 app_dict[app_label] = { 374 'name': app_ label.title(),379 'name': app_name, 375 380 'app_url': app_label + '/', 376 381 'has_module_perms': has_module_perms, 377 382 'models': [model_dict], … … 415 420 user = request.user 416 421 has_module_perms = user.has_module_perms(app_label) 417 422 app_dict = {} 423 app_name = capfirst(app_label) 424 try: 425 app_name = settings.APP_NAMES[app_label] 426 except: 427 pass 418 428 for model, model_admin in self._registry.items(): 419 429 if app_label == model._meta.app_label: 420 430 if has_module_perms: … … 435 445 # something to display, add in the necessary meta 436 446 # information. 437 447 app_dict = { 438 'name': app_ label.title(),448 'name': app_name, 439 449 'app_url': '', 440 450 'has_module_perms': has_module_perms, 441 451 'models': [model_dict], … … 445 455 # Sort the models alphabetically within each app. 446 456 app_dict['models'].sort(lambda x, y: cmp(x['name'], y['name'])) 447 457 context = { 448 'title': _('%s administration') % capfirst(app_label),458 'title': _('%s administration') % app_name, 449 459 'app_list': [app_dict], 450 460 'root_path': self.root_path, 451 461 }