From 3c950dffcf4fa164008c5a304c4839bc282a3388 Mon Sep 17 00:00:00 2001 From: Phillip Thelen Date: Wed, 22 Sep 2021 10:24:21 +0200 Subject: [PATCH] formatting --- Lagerregal/settings/base.py | 1 + devices/admin.py | 4 ++-- devices/migrations/0014_auto_20210628_1406.py | 3 ++- devices/views.py | 9 +++++---- devices/views.test.py | 4 +++- locations/migrations/0004_building_room.py | 3 ++- locations/models.py | 1 + locations/views.py | 2 +- main/management/commands/populate.py | 2 +- users/migrations/0022_alter_lageruser_timezone.py | 3 ++- 10 files changed, 20 insertions(+), 12 deletions(-) diff --git a/Lagerregal/settings/base.py b/Lagerregal/settings/base.py index 7a23ca42..b4e8e3a6 100644 --- a/Lagerregal/settings/base.py +++ b/Lagerregal/settings/base.py @@ -1,5 +1,6 @@ # Django settings for Lagerregal project. import os + from reportlab.lib.units import mm # Local time zone for this installation. Choices can be found here: diff --git a/devices/admin.py b/devices/admin.py index 97c45fe4..9c42c44d 100644 --- a/devices/admin.py +++ b/devices/admin.py @@ -1,6 +1,5 @@ from django.contrib import admin -from locations.models import Building from devices.models import Device from devices.models import DeviceInformation from devices.models import DeviceInformationType @@ -8,8 +7,9 @@ from devices.models import Manufacturer from devices.models import Note from devices.models import Picture -from locations.models import Room from devices.models import Template +from locations.models import Building +from locations.models import Room class DeviceAdmin(admin.ModelAdmin): diff --git a/devices/migrations/0014_auto_20210628_1406.py b/devices/migrations/0014_auto_20210628_1406.py index 70ef2e98..7456393f 100644 --- a/devices/migrations/0014_auto_20210628_1406.py +++ b/devices/migrations/0014_auto_20210628_1406.py @@ -1,7 +1,8 @@ # Generated by Django 3.2.3 on 2021-06-28 12:06 -from django.db import migrations, models import django.db.models.deletion +from django.db import migrations +from django.db import models class Migration(migrations.Migration): diff --git a/devices/views.py b/devices/views.py index 9813454b..de9ed8a2 100644 --- a/devices/views.py +++ b/devices/views.py @@ -4,9 +4,7 @@ import json import textwrap import time -from django.http.response import HttpResponseNotFound -import pdfrw from django.conf import settings from django.contrib import messages from django.contrib.auth.models import Group @@ -16,10 +14,12 @@ from django.db import models from django.db.models import Q from django.db.transaction import atomic -from django.http import Http404, FileResponse +from django.http import FileResponse +from django.http import Http404 from django.http import HttpResponse from django.http import HttpResponseBadRequest from django.http import HttpResponseRedirect +from django.http.response import HttpResponseNotFound from django.shortcuts import get_object_or_404 from django.shortcuts import render from django.urls import reverse @@ -38,12 +38,13 @@ from django.views.generic.detail import BaseDetailView from django.views.generic.detail import SingleObjectMixin from django.views.generic.detail import SingleObjectTemplateResponseMixin + +import pdfrw from reportlab.graphics.barcode import code128 from reportlab.lib.pagesizes import A4 from reportlab.lib.units import mm from reportlab.pdfgen import canvas from rest_framework.renderers import JSONRenderer - from reversion import revisions as reversion from reversion.models import Version diff --git a/devices/views.test.py b/devices/views.test.py index 0008d5db..b4535e88 100644 --- a/devices/views.test.py +++ b/devices/views.test.py @@ -1,6 +1,8 @@ -from devices import views import pytest +from devices import views + + class Test_Search_Parse_boolean: @pytest.fixture() diff --git a/locations/migrations/0004_building_room.py b/locations/migrations/0004_building_room.py index 1b6a2b5e..e3c3db49 100644 --- a/locations/migrations/0004_building_room.py +++ b/locations/migrations/0004_building_room.py @@ -1,7 +1,8 @@ # Generated by Django 3.2.3 on 2021-06-28 12:03 -from django.db import migrations, models import django.db.models.deletion +from django.db import migrations +from django.db import models class Migration(migrations.Migration): diff --git a/locations/models.py b/locations/models.py index 8957c1e1..7f5d81cb 100644 --- a/locations/models.py +++ b/locations/models.py @@ -1,6 +1,7 @@ from django.db import models from django.urls import reverse from django.utils.translation import ugettext_lazy as _ + import reversion diff --git a/locations/views.py b/locations/views.py index c785c75f..d41aec7a 100644 --- a/locations/views.py +++ b/locations/views.py @@ -21,8 +21,8 @@ from devices.models import Device from Lagerregal.utils import PaginationMixin from locations.models import Building -from locations.models import Section from locations.models import Room +from locations.models import Section from users.mixins import PermissionRequiredMixin diff --git a/main/management/commands/populate.py b/main/management/commands/populate.py index 10cf98ed..44515751 100644 --- a/main/management/commands/populate.py +++ b/main/management/commands/populate.py @@ -16,8 +16,8 @@ from devicetypes.models import Type from Lagerregal import utils from locations.models import Building -from locations.models import Section from locations.models import Room +from locations.models import Section from users.models import Department from users.models import DepartmentUser from users.models import Lageruser diff --git a/users/migrations/0022_alter_lageruser_timezone.py b/users/migrations/0022_alter_lageruser_timezone.py index 048c6830..ed87382c 100644 --- a/users/migrations/0022_alter_lageruser_timezone.py +++ b/users/migrations/0022_alter_lageruser_timezone.py @@ -1,6 +1,7 @@ # Generated by Django 3.2.3 on 2021-06-28 12:01 -from django.db import migrations, models +from django.db import migrations +from django.db import models class Migration(migrations.Migration):