mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-14 12:51:08 +00:00
Make black happy
Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
This commit is contained in:
parent
b564e514fd
commit
d837146b66
2 changed files with 6 additions and 3 deletions
|
@ -15,8 +15,8 @@ class CalibreImporter(Importer):
|
|||
row_mappings_guesses = []
|
||||
|
||||
for field, mapping in self.row_mappings_guesses:
|
||||
if field in ('date_added',):
|
||||
row_mappings_guesses.append((field, mapping + ['timestamp']))
|
||||
if field in ("date_added",):
|
||||
row_mappings_guesses.append((field, mapping + ["timestamp"]))
|
||||
else:
|
||||
row_mappings_guesses.append((field, mapping))
|
||||
|
||||
|
|
|
@ -175,7 +175,10 @@ class ImportItem(models.Model):
|
|||
def date_added(self):
|
||||
"""when the book was added to this dataset"""
|
||||
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):
|
||||
# Keep timezone if import already had one
|
||||
return parsed_date_added
|
||||
|
|
Loading…
Reference in a new issue