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):
return reverse('detail_lookout', kwargs={'slug': self.slug})
def save(self, *args, **kwargs):
isbn_metadata = ISBNMetadata(self.isbn)
self.title = isbn_metadata.get('title')
self.author = isbn_metadata.get('authors')
if not(self.title): # only run when initially created
isbn_metadata = ISBNMetadata(self.isbn)
self.title = isbn_metadata.get('title')
self.author = isbn_metadata.get('authors')
super().save(*args, **kwargs)
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