Refactors how readthroughs get updated

This commit is contained in:
Mouse Reeve
2021-09-22 15:59:48 -07:00
parent 8648bdc879
commit c54609d7fd
3 changed files with 124 additions and 83 deletions

View File

@ -31,6 +31,9 @@ class ReadThrough(BookWyrmModel):
def save(self, *args, **kwargs):
"""update user active time"""
self.user.update_active_date()
# an active readthrough must have an unset finish date
if self.finish_date:
self.is_active = False
super().save(*args, **kwargs)
def create_update(self):