0.4.70 fix admin
This commit is contained in:
@@ -136,7 +136,7 @@ class Admin_StaticPage(SuperModelAdmin, Admin_Trans_BaseModelViewPage):
|
||||
if request.user.is_superuser:
|
||||
return True
|
||||
|
||||
if obj.url in ('main', 'contacts'):
|
||||
if not obj or obj.url in ['main', 'contacts']:
|
||||
return False
|
||||
|
||||
admin.site.register(StaticPage,Admin_StaticPage)
|
||||
@@ -191,7 +191,7 @@ class Admin_Block(Admin_Trans_BaseModelViewPage):
|
||||
if request.user.is_superuser:
|
||||
return True
|
||||
|
||||
if obj.name in ('About US', 'machines', 'works'):
|
||||
if not obj or obj.url in ['main', 'contacts']:
|
||||
return False
|
||||
|
||||
def has_add_permission(self, request):
|
||||
|
||||
@@ -79,7 +79,7 @@ class Admin_Project(SuperModelAdmin, Admin_Trans_BaseModelViewPage):
|
||||
if request.user.is_superuser:
|
||||
return True
|
||||
|
||||
if obj.url in ('main', 'spec_technics', 'works'):
|
||||
if not obj or obj.url in ['main', 'contacts']:
|
||||
return False
|
||||
|
||||
admin.site.register(Project, Admin_Project)
|
||||
@@ -101,7 +101,7 @@ class Admin_Section(SuperModelAdmin, Admin_Trans_BaseModelViewPage):
|
||||
if request.user.is_superuser:
|
||||
return True
|
||||
|
||||
if obj.url in ('main', 'spec_technics', 'works'):
|
||||
if not obj or obj.url in ['main', 'contacts']:
|
||||
return False
|
||||
|
||||
admin.site.register(Section,Admin_Section)
|
||||
@@ -158,7 +158,7 @@ class Admin_Service(SuperModelAdmin, Admin_Trans_BaseModelViewPage):
|
||||
if request.user.is_superuser:
|
||||
return True
|
||||
|
||||
if obj.url in ('main', 'spec_technics', 'works'):
|
||||
if not obj or obj.url in ['main', 'contacts']:
|
||||
return False
|
||||
|
||||
admin.site.register(Service, Admin_Service)
|
||||
|
||||
Reference in New Issue
Block a user