def validate_local_body(self, value):
    if ((value is not None) and (value != self.context['created_by'].local_body) and (not self.context['created_by'].is_superuser) and (not (self.context['created_by'].user_type >= User.TYPE_VALUE_MAP['DistrictAdmin']))):
        raise serializers.ValidationError('Cannot create for a different local body')
    return value
def validate_local_body(self, value):
    if ((value is not None) and (value != self.context['created_by'].local_body) and (not self.context['created_by'].is_superuser) and (not (self.context['created_by'].user_type >= User.TYPE_VALUE_MAP['DistrictAdmin']))):
        raise serializers.ValidationError('Cannot create for a different local body')
    return value