def _validate_plan_accreditation_level(request, model): _validate_accreditation_level(request, model.create_accreditations, "plan", "creation")
def _validate_agreement_accreditation_level(request, model, **kwargs): levels = model.create_accreditations _validate_accreditation_level(request, levels, "agreement", "creation")
def validate_framework_accreditation_level_central(request, model): _validate_accreditation_level(request, model.central_accreditations, "framework", "creation")
def _validate_contract_accreditation_level(request, model): _validate_accreditation_level(request, model.create_accreditations, "contract", "creation")
def _validate_post_accreditation_level(request, **kwargs): tender = request.validated["tender"] mode = tender.get("mode", None) _validate_accreditation_level(request, tender.edit_accreditations, "post", "creation") _validate_accreditation_level_mode(request, mode, "post", "creation")
def _validate_transfer_accreditation_level(request, obj, attr): levels = getattr(type(obj), attr) mode = obj.get("mode", None) _validate_accreditation_level(request, levels, "ownership", "change") _validate_accreditation_level_mode(request, mode, "ownership", "change")