Add logging to snapshot
This commit is contained in:
parent
ab13b9b8f7
commit
01117b5880
|
|
@ -3,8 +3,11 @@ from django.db import models
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
|
|
||||||
from books.models import Chapter, ContentBlock, ContentBlockSnapshot
|
from books.models import Chapter, ContentBlock, ContentBlockSnapshot
|
||||||
|
from core.logger import get_logger
|
||||||
from objectives.models import ObjectiveSnapshot
|
from objectives.models import ObjectiveSnapshot
|
||||||
|
|
||||||
|
logger = get_logger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class ChapterSnapshot(models.Model):
|
class ChapterSnapshot(models.Model):
|
||||||
"""
|
"""
|
||||||
|
|
@ -127,6 +130,7 @@ class Snapshot(models.Model):
|
||||||
without_owner = Q(owner__isnull=True)
|
without_owner = Q(owner__isnull=True)
|
||||||
no_snapshot = Q(contentblocksnapshot__isnull=True)
|
no_snapshot = Q(contentblocksnapshot__isnull=True)
|
||||||
owner_user = Q(owner=user)
|
owner_user = Q(owner=user)
|
||||||
|
logger.info(f'resetting hidden properties for chapter {chapter.id}')
|
||||||
chapter.title_hidden_for.remove(selected_class)
|
chapter.title_hidden_for.remove(selected_class)
|
||||||
chapter.description_hidden_for.remove(selected_class)
|
chapter.description_hidden_for.remove(selected_class)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue