Skip to content

Commit

Permalink
Fix a la indexación cuando una serie cambia de ID
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaslavandeira committed Dec 6, 2017
1 parent 3c8b4b1 commit eaba741
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions series_tiempo_ar_api/apps/api/indexing/database_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ def _save_fields(self, distribution_model, fields):
settings.FIELD_BLACKLIST
)
field_model.metadata = json.dumps(field)

# Borra modelos viejos en caso de que haya habido un cambio de series id
distribution_model.field_set.filter(title=title).delete()
field_model.save()

@staticmethod
Expand Down

0 comments on commit eaba741

Please sign in to comment.