Fix cabinet and tags upload wizard steps
Steps were missing some entries. Closes GitLab issue #632. Thanks to Matthias Urhahn (@d4rken) for the report. Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from furl import furl
|
||||
|
||||
from django.shortcuts import get_object_or_404
|
||||
from django.utils.encoding import force_bytes
|
||||
|
||||
from mayan.apps.common.http import URL
|
||||
|
||||
from .models import DocumentMetadata, MetadataType
|
||||
|
||||
@@ -19,7 +18,7 @@ def decode_metadata_from_querystring(querystring=None):
|
||||
metadata_list = []
|
||||
if querystring:
|
||||
# Match out of order metadata_type ids with metadata values from request
|
||||
for key, value in furl(force_bytes(querystring)).args.items():
|
||||
for key, value in URL(query_string=querystring).args.items():
|
||||
if 'metadata' in key:
|
||||
index, element = key[8:].split('_')
|
||||
metadata_dict[element][index] = value
|
||||
@@ -27,10 +26,12 @@ def decode_metadata_from_querystring(querystring=None):
|
||||
# Convert the nested dictionary into a list of id+values dictionaries
|
||||
for order, identifier in metadata_dict['id'].items():
|
||||
if order in metadata_dict['value'].keys():
|
||||
metadata_list.append({
|
||||
'id': identifier,
|
||||
'value': metadata_dict['value'][order]
|
||||
})
|
||||
metadata_list.append(
|
||||
{
|
||||
'id': identifier,
|
||||
'value': metadata_dict['value'][order]
|
||||
}
|
||||
)
|
||||
|
||||
return metadata_list
|
||||
|
||||
|
||||
Reference in New Issue
Block a user