diff --git a/aleksis/apps/paweljong/schema/checkpoint.py b/aleksis/apps/paweljong/schema/checkpoint.py index 5c1b03cabd3ad7fa016b38f01626eb11ba79071e..7b4c091911cd986a092f60ff512f27f298fcccaa 100644 --- a/aleksis/apps/paweljong/schema/checkpoint.py +++ b/aleksis/apps/paweljong/schema/checkpoint.py @@ -4,9 +4,9 @@ from django.utils import timezone import graphene from graphene_django import DjangoObjectType +from aleksis.core.models import Person from aleksis.core.schema.base import PermissionsTypeMixin from aleksis.core.util.core_helpers import has_person -from aleksis.core.models import Person from ..models import Checkpoint, Event diff --git a/aleksis/apps/paweljong/schema/event_registration.py b/aleksis/apps/paweljong/schema/event_registration.py index 041ea7e092c50d588b6aade6dfe1d26764d0e0d6..8de044036d8e78ffa5d0ff54167c51244f7d192b 100644 --- a/aleksis/apps/paweljong/schema/event_registration.py +++ b/aleksis/apps/paweljong/schema/event_registration.py @@ -1,4 +1,6 @@ +from django.db import transaction from django.contrib.auth.models import User +from django.core.exceptions import ValidationError from django.utils.text import slugify from django.utils.translation import gettext as _ @@ -50,6 +52,7 @@ class SendEventRegistrationMutation(graphene.Mutation): ok = graphene.Boolean() + @transaction.atomic def mutate(self, info, event: graphene.ID, event_registration: EventRegistrationInputType, **kwargs): event = Event.objects.get(pk=event) @@ -194,4 +197,5 @@ class SendEventRegistrationMutation(graphene.Mutation): if event_registration["retraction_consent"]: return SendEventRegistrationMutation(ok=True) + raise ValidationError(_("Retraction consent is required")) return SendEventRegistrationMutation(ok=False)