Code cleaning
This commit is contained in:
parent
7155342ed2
commit
55982b83bf
|
@ -1,6 +1,5 @@
|
||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
from django.db.models.signals import post_migrate
|
|
||||||
|
|
||||||
|
|
||||||
class GASConfig(AppConfig):
|
class GASConfig(AppConfig):
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
from collections import namedtuple
|
|
||||||
|
|
||||||
from django.urls import include, re_path
|
from django.urls import include, re_path
|
||||||
from django.core.exceptions import ImproperlyConfigured
|
from django.core.exceptions import ImproperlyConfigured
|
||||||
from django.utils.module_loading import autodiscover_modules
|
from django.utils.module_loading import autodiscover_modules
|
||||||
from django.utils.translation import gettext_lazy as _
|
|
||||||
|
|
||||||
|
|
||||||
class Entry:
|
class Entry:
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
import datetime
|
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
from django.contrib.admin.utils import NestedObjects
|
from django.contrib.admin.utils import NestedObjects
|
||||||
from django.core.exceptions import ImproperlyConfigured
|
from django.core.exceptions import ImproperlyConfigured
|
||||||
from django.db import router
|
from django.db import router
|
||||||
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseBadRequest, HttpResponseNotAllowed
|
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseBadRequest
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
from django.utils.encoding import force_text
|
from django.utils.encoding import force_text
|
||||||
from django.utils.html import escape, escapejs
|
from django.utils.html import escape, escapejs
|
||||||
|
@ -13,9 +12,7 @@ from django.utils.text import capfirst
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
from django.views.generic import ListView, CreateView, UpdateView, DeleteView
|
from django.views.generic import ListView, CreateView, UpdateView, DeleteView
|
||||||
|
|
||||||
from . import forms
|
|
||||||
from . import gas_settings
|
from . import gas_settings
|
||||||
from .sites import site
|
|
||||||
|
|
||||||
|
|
||||||
class AjaxCommandsMixin:
|
class AjaxCommandsMixin:
|
||||||
|
@ -52,8 +49,8 @@ class GASMixin:
|
||||||
roles.add(self.base_role)
|
roles.add(self.base_role)
|
||||||
access_denied = (
|
access_denied = (
|
||||||
not user.is_authenticated or (
|
not user.is_authenticated or (
|
||||||
not user.is_superuser
|
not user.is_superuser
|
||||||
and user.user_roles.filter(role__in=roles).count() == 0
|
and user.user_roles.filter(role__in=roles).count() == 0
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if access_denied:
|
if access_denied:
|
||||||
|
|
Loading…
Reference in New Issue