def clean(self, *args, **kwargs):
if not self.pk:<EOL><INDENT>node = self.node<EOL>layer = Layer.objects.get(pk=node.layer_id)<EOL>if layer.participation_settings.rating_allowed is not True:<EOL><INDENT>raise ValidationError("<STR_LIT>")<EOL><DEDENT>if node.participation_settings.rating_allowed is not True:<EOL><INDENT>raise ValidationError("<STR_LIT>")<EOL><DEDENT><DEDENT>
Check if rating can be inserted for parent node or parent layer