<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def new_nodes_allowed_for_layer(self):
 """ ensure new nodes are allowed for this layer """

    if not self.pk and self.layer and not self.layer.new_nodes_allowed:
        raise ValidationError(_('New nodes are not allowed for this layer'))