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
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
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
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
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