Skip to content

Commit

Permalink
- Fix test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
afabiani committed Apr 26, 2018
1 parent 5753b66 commit ae62bfd
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions geonode/layers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,16 +570,6 @@ def file_upload(filename,
# process the layer again after that by
# doing a layer.save()
if not created and overwrite:
if upload_session:
if layer.upload_session:
layer.upload_session.layerfile_set.all().delete()
layer.upload_session.delete()

upload_session.resource = layer
upload_session.save()

layer.upload_session = upload_session

# update with new information
defaults['upload_session'] = upload_session
defaults['title'] = defaults.get('title', None) or layer.title
Expand Down Expand Up @@ -617,6 +607,10 @@ def file_upload(filename,
layer.store = ''
layer.save()

if upload_session:
upload_session.resource = layer
upload_session.save()

# set SLD
# if 'sld' in files:
# sld = None
Expand Down

0 comments on commit ae62bfd

Please sign in to comment.