Skip to content
Snippets Groups Projects
Commit 7d71e16b authored by Thorge Petersen's avatar Thorge Petersen
Browse files

Improved code readability of _copy_spatial_uri_temp_to_extras function

parent 1240f08c
No related branches found
No related tags found
1 merge request!52Added applicableLegislation and hvdCategory support
...@@ -257,15 +257,14 @@ def known_spatial_uri(key, data, errors, context): ...@@ -257,15 +257,14 @@ def known_spatial_uri(key, data, errors, context):
def _copy_spatial_uri_temp_to_extras(data): def _copy_spatial_uri_temp_to_extras(data):
''' '''
copy the field spatial_uri_temp or Copy the field spatial_uri_temp or
spatial_url_temp originating spatial_url_temp originating
from the user interface to extras from the user interface to extras
''' '''
spatial_uri = data.get(('__extras',)).get('spatial_uri_temp') extras_data = data.get(('__extras',))
if spatial_uri is None: spatial_uri = extras_data.get('spatial_uri_temp') or extras_data.get('spatial_url_temp')
spatial_uri = data.get(('__extras',)).get('spatial_url_temp')
is_spatial_uri_in_extras = _extract_value(data, 'spatial_uri') is not None if _extract_value(data, 'spatial_uri') is None:
if not is_spatial_uri_in_extras:
next_index = next_extra_index(data) next_index = next_extra_index(data)
data[('extras', next_index, 'key')] = 'spatial_uri' data[('extras', next_index, 'key')] = 'spatial_uri'
data[('extras', next_index, 'value')] = spatial_uri data[('extras', next_index, 'value')] = spatial_uri
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment