mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-23 08:36:32 +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 = []
|
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))
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue