mirror of
				https://github.com/django/django.git
				synced 2025-10-31 01:25:32 +00:00 
			
		
		
		
	magic-removal: Fixed bug in app_label calculation in adminapplist templatetag
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1824 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
		| @@ -13,7 +13,7 @@ class AdminApplistNode(template.Node): | |||||||
|         user = context['user'] |         user = context['user'] | ||||||
|  |  | ||||||
|         for app in models.get_installed_model_modules(): |         for app in models.get_installed_model_modules(): | ||||||
|             app_label = app.__name__[app.__name__.rindex('.')+1:] |             app_label = app.__name__.split('.')[:-1][-1] | ||||||
|             has_module_perms = user.has_module_perms(app_label) |             has_module_perms = user.has_module_perms(app_label) | ||||||
|             if has_module_perms: |             if has_module_perms: | ||||||
|                 model_list = [] |                 model_list = [] | ||||||
| @@ -30,8 +30,6 @@ class AdminApplistNode(template.Node): | |||||||
|  |  | ||||||
|                         # Check whether user has any perm for this module. |                         # Check whether user has any perm for this module. | ||||||
|                         # If so, add the module to the model_list. |                         # If so, add the module to the model_list. | ||||||
|                          |  | ||||||
|                          |  | ||||||
|                         if True in perms.values(): |                         if True in perms.values(): | ||||||
|                             model_list.append({ |                             model_list.append({ | ||||||
|                                 'name': capfirst(m._meta.verbose_name_plural), |                                 'name': capfirst(m._meta.verbose_name_plural), | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user