Ejemplo n.º 1
0
 def update(self, instance, validated_data):
     instance = super(ContentSummaryLogSerializer, self).update(
         instance, validated_data
     )
     # to check if a notification must be created:
     wrap_to_save_queue(parse_summarylog, instance)
     return instance
Ejemplo n.º 2
0
 def update(self, instance, validated_data):
     # This has changed, set the completion timestamp
     if validated_data.get("closed") and not instance.closed:
         instance.completion_timestamp = now()
     instance = super(ExamLogSerializer, self).update(instance, validated_data)
     # to check if a notification must be created:
     wrap_to_save_queue(parse_examlog, instance, local_now())
     return instance
Ejemplo n.º 3
0
 def create(self, validated_data):
     instance = super(ContentSummaryLogSerializer, self).create(validated_data)
     # dont create notifications upon creating a summary log for an exercise
     # notifications should only be triggered upon first attempting a question in the exercise
     if instance.kind == content_kinds.EXERCISE:
         return instance
     # to check if a notification must be created:
     wrap_to_save_queue(create_summarylog, instance)
     return instance
Ejemplo n.º 4
0
 def create(self, validated_data):
     instance = super(ExamLogSerializer, self).create(validated_data)
     # to check if a notification must be created:
     wrap_to_save_queue(create_examlog, instance, local_now())
     return instance
Ejemplo n.º 5
0
 def update(self, instance, validated_data):
     instance = super(AttemptLogSerializer, self).update(instance, validated_data)
     # to check if a notification must be created:
     wrap_to_save_queue(parse_attemptslog, instance)
     return instance