Resort python import for isort 4.3.11 (fixes #4467)

One dot imports are again behind two dot imports since this new isort
release.
This commit is contained in:
FinnStutzenstein 2019-03-06 14:53:24 +01:00
parent b978029fff
commit ecdfdf4b87
23 changed files with 89 additions and 89 deletions

View File

@ -15,8 +15,8 @@ from openslides.utils.exceptions import OpenSlidesError
from openslides.utils.models import RESTModelMixin from openslides.utils.models import RESTModelMixin
from openslides.utils.utils import to_roman from openslides.utils.utils import to_roman
from .access_permissions import ItemAccessPermissions
from ..utils.models import CASCADE_AND_AUTOUODATE, SET_NULL_AND_AUTOUPDATE from ..utils.models import CASCADE_AND_AUTOUODATE, SET_NULL_AND_AUTOUPDATE
from .access_permissions import ItemAccessPermissions
class ItemManager(models.Manager): class ItemManager(models.Manager):

View File

@ -1,8 +1,8 @@
from django.apps import apps from django.apps import apps
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
from .models import Item
from ..utils.autoupdate import inform_changed_data from ..utils.autoupdate import inform_changed_data
from .models import Item
def listen_to_related_object_post_save(sender, instance, created, **kwargs): def listen_to_related_object_post_save(sender, instance, created, **kwargs):

View File

@ -16,9 +16,9 @@ from openslides.utils.rest_api import (
list_route, list_route,
) )
from ..utils.auth import has_perm
from .access_permissions import ItemAccessPermissions from .access_permissions import ItemAccessPermissions
from .models import Item, Speaker from .models import Item, Speaker
from ..utils.auth import has_perm
# Viewsets for the REST API # Viewsets for the REST API

View File

@ -21,8 +21,8 @@ from openslides.utils.autoupdate import inform_changed_data
from openslides.utils.exceptions import OpenSlidesError from openslides.utils.exceptions import OpenSlidesError
from openslides.utils.models import RESTModelMixin from openslides.utils.models import RESTModelMixin
from .access_permissions import AssignmentAccessPermissions
from ..utils.models import CASCADE_AND_AUTOUODATE, SET_NULL_AND_AUTOUPDATE from ..utils.models import CASCADE_AND_AUTOUODATE, SET_NULL_AND_AUTOUPDATE
from .access_permissions import AssignmentAccessPermissions
class AssignmentRelatedUser(RESTModelMixin, models.Model): class AssignmentRelatedUser(RESTModelMixin, models.Model):

View File

@ -12,6 +12,7 @@ from openslides.utils.rest_api import (
ValidationError, ValidationError,
) )
from ..utils.validate import validate_html
from .models import ( from .models import (
Assignment, Assignment,
AssignmentOption, AssignmentOption,
@ -20,7 +21,6 @@ from .models import (
AssignmentVote, AssignmentVote,
models, models,
) )
from ..utils.validate import validate_html
def posts_validator(data): def posts_validator(data):

View File

@ -12,10 +12,10 @@ from openslides.utils.rest_api import (
detail_route, detail_route,
) )
from ..utils.auth import has_perm
from .access_permissions import AssignmentAccessPermissions from .access_permissions import AssignmentAccessPermissions
from .models import Assignment, AssignmentPoll, AssignmentRelatedUser from .models import Assignment, AssignmentPoll, AssignmentRelatedUser
from .serializers import AssignmentAllPollSerializer from .serializers import AssignmentAllPollSerializer
from ..utils.auth import has_perm
# Viewsets for the REST API # Viewsets for the REST API

View File

@ -5,9 +5,9 @@ from django.apps import apps
from django.core.exceptions import ValidationError as DjangoValidationError from django.core.exceptions import ValidationError as DjangoValidationError
from mypy_extensions import TypedDict from mypy_extensions import TypedDict
from ..utils.cache import element_cache
from .exceptions import ConfigError, ConfigNotFound from .exceptions import ConfigError, ConfigNotFound
from .models import ConfigStore from .models import ConfigStore
from ..utils.cache import element_cache
INPUT_TYPE_MAPPING = { INPUT_TYPE_MAPPING = {

View File

@ -4,6 +4,13 @@ from django.db import models, transaction
from django.utils.timezone import now from django.utils.timezone import now
from jsonfield import JSONField from jsonfield import JSONField
from ..utils.autoupdate import Element
from ..utils.cache import element_cache, get_element_id
from ..utils.models import (
CASCADE_AND_AUTOUODATE,
SET_NULL_AND_AUTOUPDATE,
RESTModelMixin,
)
from .access_permissions import ( from .access_permissions import (
ChatMessageAccessPermissions, ChatMessageAccessPermissions,
ConfigAccessPermissions, ConfigAccessPermissions,
@ -13,13 +20,6 @@ from .access_permissions import (
ProjectorMessageAccessPermissions, ProjectorMessageAccessPermissions,
TagAccessPermissions, TagAccessPermissions,
) )
from ..utils.autoupdate import Element
from ..utils.cache import element_cache, get_element_id
from ..utils.models import (
CASCADE_AND_AUTOUODATE,
SET_NULL_AND_AUTOUPDATE,
RESTModelMixin,
)
class ProjectorManager(models.Manager): class ProjectorManager(models.Manager):

View File

@ -1,5 +1,8 @@
from typing import Any from typing import Any
from ..utils.projector import projector_slides
from ..utils.rest_api import Field, IntegerField, ModelSerializer, ValidationError
from ..utils.validate import validate_html
from .models import ( from .models import (
ChatMessage, ChatMessage,
ConfigStore, ConfigStore,
@ -10,9 +13,6 @@ from .models import (
ProjectorMessage, ProjectorMessage,
Tag, Tag,
) )
from ..utils.projector import projector_slides
from ..utils.rest_api import Field, IntegerField, ModelSerializer, ValidationError
from ..utils.validate import validate_html
class JSONSerializerField(Field): class JSONSerializerField(Field):

View File

@ -11,28 +11,6 @@ from django.utils.timezone import now
from django.views import static from django.views import static
from django.views.generic.base import View from django.views.generic.base import View
from .access_permissions import (
ChatMessageAccessPermissions,
ConfigAccessPermissions,
CountdownAccessPermissions,
HistoryAccessPermissions,
ProjectorAccessPermissions,
ProjectorMessageAccessPermissions,
TagAccessPermissions,
)
from .config import config
from .exceptions import ConfigError, ConfigNotFound
from .models import (
ChatMessage,
ConfigStore,
Countdown,
History,
HistoryData,
ProjectionDefault,
Projector,
ProjectorMessage,
Tag,
)
from .. import __license__ as license, __url__ as url, __version__ as version from .. import __license__ as license, __url__ as url, __version__ as version
from ..users.models import User from ..users.models import User
from ..utils import views as utils_views from ..utils import views as utils_views
@ -56,6 +34,28 @@ from ..utils.rest_api import (
detail_route, detail_route,
list_route, list_route,
) )
from .access_permissions import (
ChatMessageAccessPermissions,
ConfigAccessPermissions,
CountdownAccessPermissions,
HistoryAccessPermissions,
ProjectorAccessPermissions,
ProjectorMessageAccessPermissions,
TagAccessPermissions,
)
from .config import config
from .exceptions import ConfigError, ConfigNotFound
from .models import (
ChatMessage,
ConfigStore,
Countdown,
History,
HistoryData,
ProjectionDefault,
Projector,
ProjectorMessage,
Tag,
)
# Special Django views # Special Django views

View File

@ -1,10 +1,10 @@
from django.conf import settings from django.conf import settings
from django.db import models from django.db import models
from .access_permissions import MediafileAccessPermissions
from ..core.config import config from ..core.config import config
from ..utils.autoupdate import inform_changed_data from ..utils.autoupdate import inform_changed_data
from ..utils.models import SET_NULL_AND_AUTOUPDATE, RESTModelMixin from ..utils.models import SET_NULL_AND_AUTOUPDATE, RESTModelMixin
from .access_permissions import MediafileAccessPermissions
class Mediafile(RESTModelMixin, models.Model): class Mediafile(RESTModelMixin, models.Model):

View File

@ -5,8 +5,8 @@ from django.db import models as dbmodels
from PyPDF2 import PdfFileReader from PyPDF2 import PdfFileReader
from PyPDF2.utils import PdfReadError from PyPDF2.utils import PdfReadError
from .models import Mediafile
from ..utils.rest_api import FileField, ModelSerializer, SerializerMethodField from ..utils.rest_api import FileField, ModelSerializer, SerializerMethodField
from .models import Mediafile
class AngularCompatibleFileField(FileField): class AngularCompatibleFileField(FileField):

View File

@ -1,11 +1,11 @@
from django.http import HttpResponseForbidden, HttpResponseNotFound from django.http import HttpResponseForbidden, HttpResponseNotFound
from django.views.static import serve from django.views.static import serve
from .access_permissions import MediafileAccessPermissions
from .models import Mediafile
from ..core.config import config from ..core.config import config
from ..utils.auth import has_perm from ..utils.auth import has_perm
from ..utils.rest_api import ModelViewSet, ValidationError from ..utils.rest_api import ModelViewSet, ValidationError
from .access_permissions import MediafileAccessPermissions
from .models import Mediafile
# Viewsets for the REST API # Viewsets for the REST API

View File

@ -23,6 +23,7 @@ from openslides.utils.autoupdate import inform_changed_data
from openslides.utils.exceptions import OpenSlidesError from openslides.utils.exceptions import OpenSlidesError
from openslides.utils.models import RESTModelMixin from openslides.utils.models import RESTModelMixin
from ..utils.models import CASCADE_AND_AUTOUODATE, SET_NULL_AND_AUTOUPDATE
from .access_permissions import ( from .access_permissions import (
CategoryAccessPermissions, CategoryAccessPermissions,
MotionAccessPermissions, MotionAccessPermissions,
@ -33,7 +34,6 @@ from .access_permissions import (
WorkflowAccessPermissions, WorkflowAccessPermissions,
) )
from .exceptions import WorkflowError from .exceptions import WorkflowError
from ..utils.models import CASCADE_AND_AUTOUODATE, SET_NULL_AND_AUTOUPDATE
class StatuteParagraph(RESTModelMixin, models.Model): class StatuteParagraph(RESTModelMixin, models.Model):

View File

@ -2,20 +2,6 @@ from typing import Dict, Optional
from django.db import transaction from django.db import transaction
from .models import (
Category,
Motion,
MotionBlock,
MotionChangeRecommendation,
MotionComment,
MotionCommentSection,
MotionLog,
MotionPoll,
State,
StatuteParagraph,
Submitter,
Workflow,
)
from ..core.config import config from ..core.config import config
from ..poll.serializers import default_votes_validator from ..poll.serializers import default_votes_validator
from ..utils.auth import get_group_model from ..utils.auth import get_group_model
@ -32,6 +18,20 @@ from ..utils.rest_api import (
ValidationError, ValidationError,
) )
from ..utils.validate import validate_html from ..utils.validate import validate_html
from .models import (
Category,
Motion,
MotionBlock,
MotionChangeRecommendation,
MotionComment,
MotionCommentSection,
MotionLog,
MotionPoll,
State,
StatuteParagraph,
Submitter,
Workflow,
)
def validate_workflow_field(value): def validate_workflow_field(value):

View File

@ -10,6 +10,22 @@ from django.db.models.deletion import ProtectedError
from django.http.request import QueryDict from django.http.request import QueryDict
from rest_framework import status from rest_framework import status
from ..core.config import config
from ..core.models import Tag
from ..utils.auth import has_perm, in_some_groups
from ..utils.autoupdate import inform_changed_data, inform_deleted_data
from ..utils.rest_api import (
CreateModelMixin,
DestroyModelMixin,
GenericViewSet,
ModelViewSet,
Response,
ReturnDict,
UpdateModelMixin,
ValidationError,
detail_route,
list_route,
)
from .access_permissions import ( from .access_permissions import (
CategoryAccessPermissions, CategoryAccessPermissions,
MotionAccessPermissions, MotionAccessPermissions,
@ -34,22 +50,6 @@ from .models import (
Workflow, Workflow,
) )
from .serializers import MotionPollSerializer, StateSerializer from .serializers import MotionPollSerializer, StateSerializer
from ..core.config import config
from ..core.models import Tag
from ..utils.auth import has_perm, in_some_groups
from ..utils.autoupdate import inform_changed_data, inform_deleted_data
from ..utils.rest_api import (
CreateModelMixin,
DestroyModelMixin,
GenericViewSet,
ModelViewSet,
Response,
ReturnDict,
UpdateModelMixin,
ValidationError,
detail_route,
list_route,
)
# Viewsets for the REST API # Viewsets for the REST API

View File

@ -3,10 +3,10 @@ from typing import Any, Dict
from django.contrib.contenttypes.fields import GenericRelation from django.contrib.contenttypes.fields import GenericRelation
from django.db import models from django.db import models
from .access_permissions import TopicAccessPermissions
from ..agenda.models import Item from ..agenda.models import Item
from ..mediafiles.models import Mediafile from ..mediafiles.models import Mediafile
from ..utils.models import RESTModelMixin from ..utils.models import RESTModelMixin
from .access_permissions import TopicAccessPermissions
class TopicManager(models.Manager): class TopicManager(models.Manager):

View File

@ -1,8 +1,8 @@
from openslides.utils.rest_api import ModelViewSet from openslides.utils.rest_api import ModelViewSet
from ..utils.auth import has_perm
from .access_permissions import TopicAccessPermissions from .access_permissions import TopicAccessPermissions
from .models import Topic from .models import Topic
from ..utils.auth import has_perm
class TopicViewSet(ModelViewSet): class TopicViewSet(ModelViewSet):

View File

@ -17,14 +17,14 @@ from django.db.models import Prefetch
from django.utils import timezone from django.utils import timezone
from jsonfield import JSONField from jsonfield import JSONField
from ..core.config import config
from ..utils.auth import GROUP_ADMIN_PK
from ..utils.models import CASCADE_AND_AUTOUODATE, RESTModelMixin
from .access_permissions import ( from .access_permissions import (
GroupAccessPermissions, GroupAccessPermissions,
PersonalNoteAccessPermissions, PersonalNoteAccessPermissions,
UserAccessPermissions, UserAccessPermissions,
) )
from ..core.config import config
from ..utils.auth import GROUP_ADMIN_PK
from ..utils.models import CASCADE_AND_AUTOUODATE, RESTModelMixin
class UserManager(BaseUserManager): class UserManager(BaseUserManager):

View File

@ -1,7 +1,6 @@
from django.contrib.auth.hashers import make_password from django.contrib.auth.hashers import make_password
from django.contrib.auth.models import Permission from django.contrib.auth.models import Permission
from .models import Group, PersonalNote, User
from ..utils.autoupdate import inform_changed_data from ..utils.autoupdate import inform_changed_data
from ..utils.rest_api import ( from ..utils.rest_api import (
IdPrimaryKeyRelatedField, IdPrimaryKeyRelatedField,
@ -10,6 +9,7 @@ from ..utils.rest_api import (
RelatedField, RelatedField,
ValidationError, ValidationError,
) )
from .models import Group, PersonalNote, User
USERCANSEESERIALIZER_FIELDS = ( USERCANSEESERIALIZER_FIELDS = (

View File

@ -2,8 +2,8 @@ from django.apps import apps
from django.contrib.auth.models import Permission from django.contrib.auth.models import Permission
from django.db.models import Q from django.db.models import Q
from .models import Group, User
from ..utils.auth import GROUP_ADMIN_PK, GROUP_DEFAULT_PK from ..utils.auth import GROUP_ADMIN_PK, GROUP_DEFAULT_PK
from .models import Group, User
def get_permission_change_data(sender, permissions=None, **kwargs): def get_permission_change_data(sender, permissions=None, **kwargs):

View File

@ -20,13 +20,6 @@ from django.http.request import QueryDict
from django.utils.encoding import force_bytes, force_text from django.utils.encoding import force_bytes, force_text
from django.utils.http import urlsafe_base64_decode, urlsafe_base64_encode from django.utils.http import urlsafe_base64_decode, urlsafe_base64_encode
from .access_permissions import (
GroupAccessPermissions,
PersonalNoteAccessPermissions,
UserAccessPermissions,
)
from .models import Group, PersonalNote, User
from .serializers import GroupSerializer, PermissionRelatedField
from ..core.config import config from ..core.config import config
from ..core.signals import permission_change from ..core.signals import permission_change
from ..utils.auth import ( from ..utils.auth import (
@ -47,6 +40,13 @@ from ..utils.rest_api import (
status, status,
) )
from ..utils.views import APIView from ..utils.views import APIView
from .access_permissions import (
GroupAccessPermissions,
PersonalNoteAccessPermissions,
UserAccessPermissions,
)
from .models import Group, PersonalNote, User
from .serializers import GroupSerializer, PermissionRelatedField
# Viewsets for the REST API # Viewsets for the REST API

View File

@ -17,8 +17,8 @@ from openslides.utils.autoupdate import (
) )
from openslides.utils.cache import element_cache from openslides.utils.cache import element_cache
from ..helpers import TConfig, TProjector, TUser
from ...unit.utils.cache_provider import Collection1, Collection2, get_cachable_provider from ...unit.utils.cache_provider import Collection1, Collection2, get_cachable_provider
from ..helpers import TConfig, TProjector, TUser
@pytest.fixture(autouse=True) @pytest.fixture(autouse=True)