|
|
@ -1,6 +1,6 @@ |
|
|
|
import logging |
|
|
|
|
|
|
|
from braces.views import FormMessagesMixin |
|
|
|
from compressor.utils.decorators import cached_property |
|
|
|
from crispy_forms.bootstrap import FieldWithButtons, StrictButton |
|
|
|
from crispy_forms.helper import FormHelper |
|
|
|
from crispy_forms.layout import Field, Layout |
|
|
@ -16,6 +16,7 @@ from django.http.response import Http404 |
|
|
|
from django.shortcuts import redirect |
|
|
|
from django.utils.decorators import classonlymethod |
|
|
|
from django.utils.encoding import force_text |
|
|
|
from django.utils.functional import cached_property |
|
|
|
from django.utils.translation import string_concat |
|
|
|
from django.utils.translation import ugettext_lazy as _ |
|
|
|
from django.views.generic import (CreateView, DeleteView, DetailView, ListView, |
|
|
@ -29,6 +30,7 @@ from sapl.rules.map_rules import (RP_ADD, RP_CHANGE, RP_DELETE, RP_DETAIL, |
|
|
|
from sapl.settings import BASE_DIR |
|
|
|
from sapl.utils import normalize |
|
|
|
|
|
|
|
|
|
|
|
ACTION_LIST, ACTION_CREATE, ACTION_DETAIL, ACTION_UPDATE, ACTION_DELETE = \ |
|
|
|
'list', 'create', 'detail', 'update', 'delete' |
|
|
|
|
|
|
@ -558,7 +560,8 @@ class CrudListView(PermissionRequiredContainerCrudMixin, ListView): |
|
|
|
fm = model._meta.get_field(fo) |
|
|
|
except Exception as e: |
|
|
|
username = self.request.user.username |
|
|
|
self.logger.error("user=" + username + ". " + str(e)) |
|
|
|
self.logger.error( |
|
|
|
"user=" + username + ". " + str(e)) |
|
|
|
pass |
|
|
|
|
|
|
|
if fm and hasattr(fm, 'related_model')\ |
|
|
@ -882,7 +885,7 @@ class CrudDeleteView(PermissionRequiredContainerCrudMixin, |
|
|
|
error_msg2 += '{} - {}, '.format( |
|
|
|
i._meta.verbose_name, i |
|
|
|
) |
|
|
|
error_msg2 = error_msg2[:len(error_msg2)-2] + '.' |
|
|
|
error_msg2 = error_msg2[:len(error_msg2) - 2] + '.' |
|
|
|
error_msg += '</ul>' |
|
|
|
|
|
|
|
username = request.user.username |
|
|
|