mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-18 04:55:44 +00:00
resort imports
This commit is contained in:
@ -5,18 +5,16 @@ Provides a JSON API for common components.
|
||||
import json
|
||||
|
||||
from django.http.response import HttpResponse
|
||||
from django.urls import include, path, re_path
|
||||
from django.utils.decorators import method_decorator
|
||||
from django.urls import path
|
||||
from django.views.decorators.csrf import csrf_exempt
|
||||
from django.urls import include, re_path
|
||||
|
||||
from rest_framework.views import APIView
|
||||
from rest_framework.response import Response
|
||||
from rest_framework.exceptions import NotAcceptable, NotFound
|
||||
from django_filters.rest_framework import DjangoFilterBackend
|
||||
from rest_framework import filters, generics, permissions
|
||||
from rest_framework import serializers
|
||||
from django_q.tasks import async_task
|
||||
from rest_framework import filters, generics, permissions, serializers
|
||||
from rest_framework.exceptions import NotAcceptable, NotFound
|
||||
from rest_framework.response import Response
|
||||
from rest_framework.views import APIView
|
||||
|
||||
import common.models
|
||||
import common.serializers
|
||||
|
@ -4,7 +4,6 @@ import logging
|
||||
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
logger = logging.getLogger('inventree')
|
||||
|
||||
|
||||
|
@ -2,12 +2,13 @@
|
||||
Files management tools.
|
||||
"""
|
||||
|
||||
from rapidfuzz import fuzz
|
||||
import tablib
|
||||
import os
|
||||
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
import tablib
|
||||
from rapidfuzz import fuzz
|
||||
|
||||
|
||||
class FileManager:
|
||||
|
@ -3,45 +3,41 @@ Common database model definitions.
|
||||
These models are 'generic' and do not fit a particular business logic object.
|
||||
"""
|
||||
|
||||
import os
|
||||
import base64
|
||||
import decimal
|
||||
import math
|
||||
import uuid
|
||||
import hashlib
|
||||
import hmac
|
||||
import json
|
||||
import hashlib
|
||||
import base64
|
||||
from secrets import compare_digest
|
||||
import logging
|
||||
import math
|
||||
import os
|
||||
import uuid
|
||||
from datetime import datetime, timedelta
|
||||
from secrets import compare_digest
|
||||
|
||||
from django.apps import apps
|
||||
from django.db import models, transaction
|
||||
from django.db.utils import IntegrityError, OperationalError
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.models import User, Group
|
||||
from django.contrib.auth.models import Group, User
|
||||
from django.contrib.contenttypes.fields import GenericForeignKey
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.contrib.humanize.templatetags.humanize import naturaltime
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.core.validators import MinValueValidator, URLValidator
|
||||
from django.db import models, transaction
|
||||
from django.db.utils import IntegrityError, OperationalError
|
||||
from django.urls import reverse
|
||||
from django.utils.timezone import now
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from djmoney.settings import CURRENCY_CHOICES
|
||||
from djmoney.contrib.exchange.models import convert_money
|
||||
from djmoney.contrib.exchange.exceptions import MissingRate
|
||||
|
||||
from djmoney.contrib.exchange.models import convert_money
|
||||
from djmoney.settings import CURRENCY_CHOICES
|
||||
from rest_framework.exceptions import PermissionDenied
|
||||
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django.core.validators import MinValueValidator, URLValidator
|
||||
from django.core.exceptions import ValidationError
|
||||
|
||||
import InvenTree.helpers
|
||||
import InvenTree.fields
|
||||
import InvenTree.helpers
|
||||
import InvenTree.validators
|
||||
|
||||
import logging
|
||||
|
||||
|
||||
logger = logging.getLogger('inventree')
|
||||
|
||||
|
||||
|
@ -1,13 +1,12 @@
|
||||
import logging
|
||||
from datetime import timedelta
|
||||
|
||||
from common.models import NotificationEntry, NotificationMessage
|
||||
from InvenTree.helpers import inheritors
|
||||
from InvenTree.ready import isImportingData
|
||||
from common.models import NotificationEntry, NotificationMessage
|
||||
from plugin import registry
|
||||
from plugin.models import NotificationUserSetting
|
||||
|
||||
|
||||
logger = logging.getLogger('inventree')
|
||||
|
||||
|
||||
|
@ -2,12 +2,12 @@
|
||||
JSON serializers for common components
|
||||
"""
|
||||
|
||||
from InvenTree.serializers import InvenTreeModelSerializer
|
||||
from InvenTree.helpers import get_objectreference
|
||||
|
||||
from rest_framework import serializers
|
||||
|
||||
from common.models import InvenTreeSetting, InvenTreeUserSetting, NotificationMessage
|
||||
from common.models import (InvenTreeSetting, InvenTreeUserSetting,
|
||||
NotificationMessage)
|
||||
from InvenTree.helpers import get_objectreference
|
||||
from InvenTree.serializers import InvenTreeModelSerializer
|
||||
|
||||
|
||||
class SettingsSerializer(InvenTreeModelSerializer):
|
||||
|
@ -2,15 +2,17 @@
|
||||
User-configurable settings for the common app
|
||||
"""
|
||||
|
||||
from moneyed import CURRENCIES
|
||||
from django.conf import settings
|
||||
|
||||
from moneyed import CURRENCIES
|
||||
|
||||
|
||||
def currency_code_default():
|
||||
"""
|
||||
Returns the default currency code (or USD if not specified)
|
||||
"""
|
||||
from django.db.utils import ProgrammingError
|
||||
|
||||
from common.models import InvenTreeSetting
|
||||
|
||||
try:
|
||||
|
@ -1,9 +1,8 @@
|
||||
import logging
|
||||
from datetime import timedelta, datetime
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
from django.core.exceptions import AppRegistryNotReady
|
||||
|
||||
|
||||
logger = logging.getLogger('inventree')
|
||||
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
from common.notifications import NotificationMethod, SingleNotificationMethod, BulkNotificationMethod, storage
|
||||
from plugin.models import NotificationUserSetting
|
||||
from part.test_part import BaseNotificationIntegrationTest
|
||||
import plugin.templatetags.plugin_extras as plugin_tags
|
||||
from common.notifications import (BulkNotificationMethod, NotificationMethod,
|
||||
SingleNotificationMethod, storage)
|
||||
from part.test_part import BaseNotificationIntegrationTest
|
||||
from plugin.models import NotificationUserSetting
|
||||
|
||||
|
||||
class BaseNotificationTests(BaseNotificationIntegrationTest):
|
||||
|
@ -2,9 +2,10 @@
|
||||
from django.test import TestCase
|
||||
|
||||
from common.models import NotificationEntry
|
||||
from . import tasks as common_tasks
|
||||
from InvenTree.tasks import offload_task
|
||||
|
||||
from . import tasks as common_tasks
|
||||
|
||||
|
||||
class TaskTest(TestCase):
|
||||
"""
|
||||
|
@ -1,19 +1,20 @@
|
||||
|
||||
from http import HTTPStatus
|
||||
import json
|
||||
from datetime import timedelta
|
||||
from http import HTTPStatus
|
||||
|
||||
from django.test import TestCase, Client
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.test import Client, TestCase
|
||||
from django.urls import reverse
|
||||
|
||||
from InvenTree.api_tester import InvenTreeAPITestCase
|
||||
from InvenTree.helpers import str2bool
|
||||
from plugin.models import NotificationUserSetting, PluginConfig
|
||||
from plugin import registry
|
||||
from plugin.models import NotificationUserSetting, PluginConfig
|
||||
|
||||
from .models import InvenTreeSetting, InvenTreeUserSetting, WebhookEndpoint, WebhookMessage, NotificationEntry, ColorTheme
|
||||
from .api import WebhookView
|
||||
from .models import (ColorTheme, InvenTreeSetting, InvenTreeUserSetting,
|
||||
NotificationEntry, WebhookEndpoint, WebhookMessage)
|
||||
|
||||
CONTENT_TYPE_JSON = 'application/json'
|
||||
|
||||
|
@ -4,12 +4,12 @@ Django views for interacting with common models
|
||||
|
||||
import os
|
||||
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django.conf import settings
|
||||
from django.core.files.storage import FileSystemStorage
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from formtools.wizard.views import SessionWizardView
|
||||
from crispy_forms.helper import FormHelper
|
||||
from formtools.wizard.views import SessionWizardView
|
||||
|
||||
from InvenTree.views import AjaxView
|
||||
|
||||
|
Reference in New Issue
Block a user