Commit 78453c3e authored by Daniel W Bond's avatar Daniel W Bond

do not overwrite entered data for isbn data lookup, e.g. if subsequently edited

parent feae9c03
...@@ -44,9 +44,10 @@ class Lookout(TimeStampedModel): ...@@ -44,9 +44,10 @@ class Lookout(TimeStampedModel):
return reverse('detail_lookout', kwargs={'slug': self.slug}) return reverse('detail_lookout', kwargs={'slug': self.slug})
def save(self, *args, **kwargs): def save(self, *args, **kwargs):
isbn_metadata = ISBNMetadata(self.isbn) if not(self.title): # only run when initially created
self.title = isbn_metadata.get('title') isbn_metadata = ISBNMetadata(self.isbn) = isbn_metadata.get('authors') self.title = isbn_metadata.get('title') = isbn_metadata.get('authors')
super().save(*args, **kwargs) super().save(*args, **kwargs)
def __unicode__(self): def __unicode__(self):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment