Skip to content

Commit

Permalink
fix(models): always update bibsonomy field when saving Reference
Browse files Browse the repository at this point in the history
  • Loading branch information
b1rger committed Aug 26, 2024
1 parent 5add6fa commit be6a403
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions apis_bibsonomy/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,7 @@ def similar_references(self, with_self=False):
return Reference.objects.exclude(pk=self.pk).filter(similarity)
return Reference.objects.filter(similarity)

def save(
self, force_insert=False, force_update=False, using=None, update_fields=None
):
if update_fields is not None and "bibtex" in update_fields:
self.bibtex = None
if self.bibtex is None and self.bibs_url is not None:
def save(self, *args, **kwargs):
if self.bibs_url:
self.bibtex = get_bibtex_from_url(self.bibs_url)

super().save(
force_insert=force_insert,
force_update=force_update,
using=using,
update_fields=update_fields,
)
super().save(*args, **kwargs)

0 comments on commit be6a403

Please sign in to comment.