mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Fixed duplicate check
This commit is contained in:
parent
a1fa3315b1
commit
22249206d2
@ -209,6 +209,7 @@ class FileManagementFormView(MultiStepFormView):
|
||||
context.update({'columns': self.columns})
|
||||
|
||||
# Load extra context data
|
||||
print(self.extra_context_data)
|
||||
for key, items in self.extra_context_data.items():
|
||||
context.update({key: items})
|
||||
|
||||
@ -449,8 +450,8 @@ class FileManagementFormView(MultiStepFormView):
|
||||
|
||||
if guess:
|
||||
n = list(self.column_selections.values()).count(self.column_selections[col])
|
||||
if n > 1:
|
||||
duplicates.append(col)
|
||||
if n > 1 and self.column_selections[col] not in duplicates:
|
||||
duplicates.append(self.column_selections[col])
|
||||
|
||||
# Store extra context data
|
||||
self.extra_context_data = {
|
||||
|
@ -55,7 +55,7 @@
|
||||
<td>
|
||||
{{ col }}
|
||||
{% for duplicate in duplicates %}
|
||||
{% if duplicate == col.name %}
|
||||
{% if duplicate == col.value %}
|
||||
<div class='alert alert-danger alert-block text-center' role='alert' style='padding:2px; margin-top:6px; margin-bottom:2px'>
|
||||
<b>{% trans "Duplicate selection" %}</b>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user