Make black happy

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
This commit is contained in:
André Jaenisch 2022-05-23 20:59:28 +02:00
parent b564e514fd
commit d837146b66
No known key found for this signature in database
GPG key ID: 5A668E771F1ED854
2 changed files with 6 additions and 3 deletions

View file

@ -15,8 +15,8 @@ class CalibreImporter(Importer):
row_mappings_guesses = [] row_mappings_guesses = []
for field, mapping in self.row_mappings_guesses: for field, mapping in self.row_mappings_guesses:
if field in ('date_added',): if field in ("date_added",):
row_mappings_guesses.append((field, mapping + ['timestamp'])) row_mappings_guesses.append((field, mapping + ["timestamp"]))
else: else:
row_mappings_guesses.append((field, mapping)) row_mappings_guesses.append((field, mapping))

View file

@ -175,7 +175,10 @@ class ImportItem(models.Model):
def date_added(self): def date_added(self):
"""when the book was added to this dataset""" """when the book was added to this dataset"""
if self.normalized_data.get("date_added"): if self.normalized_data.get("date_added"):
parsed_date_added = dateutil.parser.parse(self.normalized_data.get("date_added")) parsed_date_added = dateutil.parser.parse(
self.normalized_data.get("date_added")
)
if timezone.is_aware(parsed_date_added): if timezone.is_aware(parsed_date_added):
# Keep timezone if import already had one # Keep timezone if import already had one
return parsed_date_added return parsed_date_added