Add logging to snapshot

This commit is contained in:
Ramon Wenger 2021-06-14 15:45:54 +02:00
parent ab13b9b8f7
commit 01117b5880
1 changed files with 4 additions and 0 deletions

View File

@ -3,8 +3,11 @@ from django.db import models
from django.db.models import Q
from books.models import Chapter, ContentBlock, ContentBlockSnapshot
from core.logger import get_logger
from objectives.models import ObjectiveSnapshot
logger = get_logger(__name__)
class ChapterSnapshot(models.Model):
"""
@ -127,6 +130,7 @@ class Snapshot(models.Model):
without_owner = Q(owner__isnull=True)
no_snapshot = Q(contentblocksnapshot__isnull=True)
owner_user = Q(owner=user)
logger.info(f'resetting hidden properties for chapter {chapter.id}')
chapter.title_hidden_for.remove(selected_class)
chapter.description_hidden_for.remove(selected_class)