summaryrefslogtreecommitdiff
path: root/ishtar_common/views.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-06-11 18:26:05 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-06-11 18:26:05 +0200
commit13ff56b22754b5decd963e1b1fbca8244f2facce (patch)
tree42a6c85ea006b92e048c0e24b19a548b97e607e1 /ishtar_common/views.py
parent22b3c7842139641303b410f9ea75847c3f28dfec (diff)
downloadIshtar-13ff56b22754b5decd963e1b1fbca8244f2facce.tar.bz2
Ishtar-13ff56b22754b5decd963e1b1fbca8244f2facce.zip
Imports: catch configuration error - add configuration for WarehouseDivisionLink
Diffstat (limited to 'ishtar_common/views.py')
-rw-r--r--ishtar_common/views.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/ishtar_common/views.py b/ishtar_common/views.py
index 2c2a6fe7e..decbef589 100644
--- a/ishtar_common/views.py
+++ b/ishtar_common/views.py
@@ -1792,9 +1792,9 @@ class ImportListView(IshtarMixin, LoginRequiredMixin, ListView):
def get_queryset(self):
q = self.model.objects.exclude(state='AC')
if self.request.user.is_superuser:
- return q.order_by('-creation_date').order_by('-end_date')
+ return q.order_by('-pk')
user = models.IshtarUser.objects.get(pk=self.request.user.pk)
- return q.filter(user=user).order_by('-end_date')
+ return q.filter(user=user).order_by('-pk')
def post(self, request, *args, **kwargs):
for field in request.POST:
@@ -2177,9 +2177,11 @@ class ImportStepByStepView(IshtarMixin, LoginRequiredMixin, TemplateView):
def transform_keys_to_label(self, path, cls, dct):
value_dct = {}
for k in dct:
- label = unicode(
- get_field_labels_from_path(cls, [k])[0]
- )
+ label = get_field_labels_from_path(cls, [k])
+ if label:
+ label = unicode(label[0])
+ else:
+ label = k
concat_path = u"__".join(list(path) + [k])
if concat_path in self.path_to_column: