New version of black, new whitespace
This commit is contained in:
@ -7,14 +7,14 @@ from .base_model import BookWyrmModel
|
||||
|
||||
|
||||
class ProgressMode(models.TextChoices):
|
||||
""" types of prgress available """
|
||||
"""types of prgress available"""
|
||||
|
||||
PAGE = "PG", "page"
|
||||
PERCENT = "PCT", "percent"
|
||||
|
||||
|
||||
class ReadThrough(BookWyrmModel):
|
||||
""" Store a read through a book in the database. """
|
||||
"""Store a read through a book in the database."""
|
||||
|
||||
user = models.ForeignKey("User", on_delete=models.PROTECT)
|
||||
book = models.ForeignKey("Edition", on_delete=models.PROTECT)
|
||||
@ -28,13 +28,13 @@ class ReadThrough(BookWyrmModel):
|
||||
finish_date = models.DateTimeField(blank=True, null=True)
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
""" update user active time """
|
||||
"""update user active time"""
|
||||
self.user.last_active_date = timezone.now()
|
||||
self.user.save(broadcast=False)
|
||||
super().save(*args, **kwargs)
|
||||
|
||||
def create_update(self):
|
||||
""" add update to the readthrough """
|
||||
"""add update to the readthrough"""
|
||||
if self.progress:
|
||||
return self.progressupdate_set.create(
|
||||
user=self.user, progress=self.progress, mode=self.progress_mode
|
||||
@ -43,7 +43,7 @@ class ReadThrough(BookWyrmModel):
|
||||
|
||||
|
||||
class ProgressUpdate(BookWyrmModel):
|
||||
""" Store progress through a book in the database. """
|
||||
"""Store progress through a book in the database."""
|
||||
|
||||
user = models.ForeignKey("User", on_delete=models.PROTECT)
|
||||
readthrough = models.ForeignKey("ReadThrough", on_delete=models.CASCADE)
|
||||
@ -53,7 +53,7 @@ class ProgressUpdate(BookWyrmModel):
|
||||
)
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
""" update user active time """
|
||||
"""update user active time"""
|
||||
self.user.last_active_date = timezone.now()
|
||||
self.user.save(broadcast=False)
|
||||
super().save(*args, **kwargs)
|
||||
|
Reference in New Issue
Block a user