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 c014623 commit 5753b66
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions geonode/layers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,14 +596,17 @@ def file_upload(filename,
defaults['category'] = defaults.get('category', None) or layer.category

try:
db_layer = Layer.objects.get(id=layer.id)
db_layer = Layer.objects.filter(id=layer.id)
if created:
db_layer = Layer.objects.filter(id=layer.id)
else:
db_layer = Layer.objects.filter(alternate=title)
db_layer.update(**defaults)
layer.refresh_from_db()
except Layer.DoesNotExist:
import traceback
tb = traceback.format_exc()
logger.error(tb)
raise

# Pass the parameter overwrite to tell whether the
# geoserver_post_save_signal should upload the new file or not
Expand Down

0 comments on commit 5753b66

Please sign in to comment.