Commit 8ad9226b authored by Daniel W Bond's avatar Daniel W Bond

checking for *both* an empty title and author

parent 78453c3e
...@@ -44,7 +44,7 @@ class Lookout(TimeStampedModel): ...@@ -44,7 +44,7 @@ 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):
if not(self.title): # only run when initially created if not(self.title and self.author): # only run when initially created
isbn_metadata = ISBNMetadata(self.isbn) isbn_metadata = ISBNMetadata(self.isbn)
self.title = isbn_metadata.get('title') self.title = isbn_metadata.get('title')
self.author = isbn_metadata.get('authors') self.author = isbn_metadata.get('authors')
......
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