288 | | if has_module_perms: |
289 | | perms = { |
290 | | 'add': model_admin.has_add_permission(request), |
291 | | 'change': model_admin.has_change_permission(request), |
292 | | 'delete': model_admin.has_delete_permission(request), |
293 | | } |
| 288 | perms = { |
| 289 | 'add': model_admin.has_add_permission(request), |
| 290 | 'change': model_admin.has_change_permission(request), |
| 291 | 'delete': model_admin.has_delete_permission(request), |
| 292 | } |
295 | | # Check whether user has any perm for this module. |
296 | | # If so, add the module to the model_list. |
297 | | if True in perms.values(): |
298 | | model_dict = { |
299 | | 'name': capfirst(model._meta.verbose_name_plural), |
300 | | 'admin_url': mark_safe('%s/%s/' % (app_label, model.__name__.lower())), |
301 | | 'perms': perms, |
| 294 | # Check whether user has any perm for this module. |
| 295 | # If so, add the module to the model_list. |
| 296 | if True in perms.values(): |
| 297 | model_dict = { |
| 298 | 'name': capfirst(model._meta.verbose_name_plural), |
| 299 | 'admin_url': mark_safe('%s/%s/' % (app_label, model.__name__.lower())), |
| 300 | 'perms': perms, |
| 301 | } |
| 302 | if app_label in app_dict: |
| 303 | app_dict[app_label]['models'].append(model_dict) |
| 304 | else: |
| 305 | app_dict[app_label] = { |
| 306 | 'name': app_label.title(), |
| 307 | 'has_module_perms': has_module_perms, |
| 308 | 'models': [model_dict], |