PEP fixes in /InvenTree

This commit is contained in:
Oliver Walters 2019-04-14 09:33:17 +10:00
parent ac3a4e3de4
commit 29ab19d51d
4 changed files with 4 additions and 8 deletions

View File

@ -11,4 +11,4 @@ class HelperForm(forms.ModelForm):
super(forms.ModelForm, self).__init__(*args, **kwargs) super(forms.ModelForm, self).__init__(*args, **kwargs)
self.helper = FormHelper() self.helper = FormHelper()
self.helper.form_tag = False self.helper.form_tag = False

View File

@ -23,4 +23,4 @@ class AuthRequiredMiddleware(object):
# Code to be executed for each request/response after # Code to be executed for each request/response after
# the view is called. # the view is called.
return response return response

View File

@ -3,10 +3,10 @@ from __future__ import unicode_literals
from rest_framework import serializers from rest_framework import serializers
from rest_framework import generics from rest_framework import generics
from rest_framework import mixins
from django.contrib.auth.models import User from django.contrib.auth.models import User
class UserSerializer(serializers.ModelSerializer): class UserSerializer(serializers.ModelSerializer):
class Meta: 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]: if ctx_data.get('_is_final', False) in [True, u'true', u'True', 1]:
super(generics.UpdateAPIView, self).perform_update(serializer) super(generics.UpdateAPIView, self).perform_update(serializer)
else: else:
pass pass

View File

@ -9,7 +9,6 @@ from django.views.generic import UpdateView, CreateView, DeleteView
from django.views.generic.base import TemplateView from django.views.generic.base import TemplateView
from rest_framework import views from rest_framework import views
from django.http import JsonResponse
class TreeSerializer(views.APIView): class TreeSerializer(views.APIView):
@ -159,9 +158,6 @@ class AjaxUpdateView(AjaxMixin, UpdateView):
return response return response
def get(self, request, *args, **kwargs): def get(self, request, *args, **kwargs):
response = super(UpdateView, self).get(request, *args, **kwargs)
if request.is_ajax(): if request.is_ajax():
form = self.form_class(instance=self.get_object()) form = self.form_class(instance=self.get_object())