should not be able to call create view if user cannot create
This commit is contained in:
parent
01e0e27241
commit
a0f57f59a9
1 changed files with 4 additions and 1 deletions
|
@ -177,13 +177,16 @@ def edit(request, pk=None, model=None, level=None, space=None, on_top_of=None, e
|
|||
|
||||
new = obj is None
|
||||
|
||||
if new and not edit_utils.can_create:
|
||||
raise PermissionDenied
|
||||
|
||||
# noinspection PyProtectedMember
|
||||
ctx = {
|
||||
'path': request.path,
|
||||
'pk': pk,
|
||||
'model_name': model.__name__.lower(),
|
||||
'model_title': model._meta.verbose_name,
|
||||
'can_edit': can_edit and (not new or edit_utils.can_create),
|
||||
'can_edit': can_edit,
|
||||
'new': new,
|
||||
'title': obj.title if obj else None,
|
||||
'geometry_url': edit_utils.geometry_url,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue