2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-05-06 07:18:48 +00:00
This commit is contained in:
Oliver Walters 2019-06-28 00:15:23 +10:00
parent 872329c340
commit 67b53d9983
4 changed files with 5 additions and 16 deletions

View File

@ -6,7 +6,6 @@ import io
import json import json
import os.path import os.path
from PIL import Image from PIL import Image
import tablib
from wsgiref.util import FileWrapper from wsgiref.util import FileWrapper
from django.http import StreamingHttpResponse from django.http import StreamingHttpResponse

View File

@ -9,7 +9,6 @@ import os
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError
from .models import Part, BomItem
from InvenTree.helpers import DownloadFile from InvenTree.helpers import DownloadFile
@ -100,10 +99,6 @@ class BomUploadManager:
self.header_map[header] = match 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): def get_header(self, header_name):
""" Returns the matching header name for the internal name """ """ Returns the matching header name for the internal name """
@ -147,14 +142,12 @@ class BomUploadManager:
return None return None
def get_headers(self): def get_headers(self):
""" Return a list of headers for the thingy """ """ Return a list of headers for the thingy """
headers = [] headers = []
return headers return headers
def col_count(self): def col_count(self):
if self.data is None: if self.data is None:
return 0 return 0

View File

@ -13,6 +13,7 @@ def inrange(n, *args, **kwargs):
""" Return range(n) for iterating through a numeric quantity """ """ Return range(n) for iterating through a numeric quantity """
return range(n) return range(n)
@register.simple_tag() @register.simple_tag()
def multiply(x, y, *args, **kwargs): def multiply(x, y, *args, **kwargs):
""" Multiply two numbers together """ """ Multiply two numbers together """

View File

@ -5,9 +5,6 @@ Django views for interacting with Part app
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import unicode_literals from __future__ import unicode_literals
import tablib
import os
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError
from django.shortcuts import get_object_or_404 from django.shortcuts import get_object_or_404
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
@ -701,7 +698,7 @@ class BomUpload(AjaxView, FormMixin):
except ValidationError as e: except ValidationError as e:
errors = e.error_dict errors = e.error_dict
for k,v in errors.items(): for k, v in errors.items():
self.form.errors[k] = v self.form.errors[k] = v
data = { data = {
@ -743,7 +740,6 @@ class BomUpload(AjaxView, FormMixin):
# Did the user POST a file named bom_file? # Did the user POST a file named bom_file?
form_step = request.POST.get('form_step', None) form_step = request.POST.get('form_step', None)
if form_step == 'select_file': if form_step == 'select_file':