From 29ab19d51df7d0d724c415da170379776377a2d5 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sun, 14 Apr 2019 09:33:17 +1000 Subject: [PATCH] PEP fixes in /InvenTree --- InvenTree/InvenTree/forms.py | 2 +- InvenTree/InvenTree/middleware.py | 2 +- InvenTree/InvenTree/serializers.py | 4 ++-- InvenTree/InvenTree/views.py | 4 ---- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/InvenTree/InvenTree/forms.py b/InvenTree/InvenTree/forms.py index d3ff976984..002a83e896 100644 --- a/InvenTree/InvenTree/forms.py +++ b/InvenTree/InvenTree/forms.py @@ -11,4 +11,4 @@ class HelperForm(forms.ModelForm): super(forms.ModelForm, self).__init__(*args, **kwargs) self.helper = FormHelper() - self.helper.form_tag = False \ No newline at end of file + self.helper.form_tag = False diff --git a/InvenTree/InvenTree/middleware.py b/InvenTree/InvenTree/middleware.py index 13b1a135fe..3a5c4f059f 100644 --- a/InvenTree/InvenTree/middleware.py +++ b/InvenTree/InvenTree/middleware.py @@ -23,4 +23,4 @@ class AuthRequiredMiddleware(object): # Code to be executed for each request/response after # the view is called. - return response \ No newline at end of file + return response diff --git a/InvenTree/InvenTree/serializers.py b/InvenTree/InvenTree/serializers.py index 590152a331..57eddd53bd 100644 --- a/InvenTree/InvenTree/serializers.py +++ b/InvenTree/InvenTree/serializers.py @@ -3,10 +3,10 @@ from __future__ import unicode_literals from rest_framework import serializers from rest_framework import generics -from rest_framework import mixins from django.contrib.auth.models import User + class UserSerializer(serializers.ModelSerializer): class Meta: @@ -33,4 +33,4 @@ class DraftRUDView(generics.RetrieveAPIView, generics.UpdateAPIView, generics.De if ctx_data.get('_is_final', False) in [True, u'true', u'True', 1]: super(generics.UpdateAPIView, self).perform_update(serializer) else: - pass \ No newline at end of file + pass diff --git a/InvenTree/InvenTree/views.py b/InvenTree/InvenTree/views.py index 985c676417..9d9536f886 100644 --- a/InvenTree/InvenTree/views.py +++ b/InvenTree/InvenTree/views.py @@ -9,7 +9,6 @@ from django.views.generic import UpdateView, CreateView, DeleteView from django.views.generic.base import TemplateView from rest_framework import views -from django.http import JsonResponse class TreeSerializer(views.APIView): @@ -159,9 +158,6 @@ class AjaxUpdateView(AjaxMixin, UpdateView): return response def get(self, request, *args, **kwargs): - - response = super(UpdateView, self).get(request, *args, **kwargs) - if request.is_ajax(): form = self.form_class(instance=self.get_object())