mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-06 07:18:48 +00:00
PEP
This commit is contained in:
parent
872329c340
commit
67b53d9983
@ -6,7 +6,6 @@ import io
|
||||
import json
|
||||
import os.path
|
||||
from PIL import Image
|
||||
import tablib
|
||||
|
||||
from wsgiref.util import FileWrapper
|
||||
from django.http import StreamingHttpResponse
|
||||
|
@ -9,7 +9,6 @@ import os
|
||||
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django.core.exceptions import ValidationError
|
||||
from .models import Part, BomItem
|
||||
|
||||
from InvenTree.helpers import DownloadFile
|
||||
|
||||
@ -100,10 +99,6 @@ class BomUploadManager:
|
||||
|
||||
self.header_map[header] = match
|
||||
|
||||
# Now we have mapped data to each header
|
||||
for k,v in self.header_map.items():
|
||||
print(k, '->', v)
|
||||
|
||||
def get_header(self, header_name):
|
||||
""" Returns the matching header name for the internal name """
|
||||
|
||||
@ -147,14 +142,12 @@ class BomUploadManager:
|
||||
|
||||
return None
|
||||
|
||||
|
||||
def get_headers(self):
|
||||
""" Return a list of headers for the thingy """
|
||||
headers = []
|
||||
|
||||
return headers
|
||||
|
||||
|
||||
def col_count(self):
|
||||
if self.data is None:
|
||||
return 0
|
||||
|
@ -13,6 +13,7 @@ def inrange(n, *args, **kwargs):
|
||||
""" Return range(n) for iterating through a numeric quantity """
|
||||
return range(n)
|
||||
|
||||
|
||||
@register.simple_tag()
|
||||
def multiply(x, y, *args, **kwargs):
|
||||
""" Multiply two numbers together """
|
||||
|
@ -5,9 +5,6 @@ Django views for interacting with Part app
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import tablib
|
||||
import os
|
||||
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.shortcuts import get_object_or_404
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
@ -701,7 +698,7 @@ class BomUpload(AjaxView, FormMixin):
|
||||
except ValidationError as e:
|
||||
errors = e.error_dict
|
||||
|
||||
for k,v in errors.items():
|
||||
for k, v in errors.items():
|
||||
self.form.errors[k] = v
|
||||
|
||||
data = {
|
||||
@ -743,7 +740,6 @@ class BomUpload(AjaxView, FormMixin):
|
||||
|
||||
# Did the user POST a file named bom_file?
|
||||
|
||||
|
||||
form_step = request.POST.get('form_step', None)
|
||||
|
||||
if form_step == 'select_file':
|
||||
|
Loading…
x
Reference in New Issue
Block a user