Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Paweljong
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Teckids
Projekt Hack-n-Fun
AlekSIS-App-Paweljong
Commits
073d0e2f
Commit
073d0e2f
authored
1 month ago
by
magicfelix
Browse files
Options
Downloads
Patches
Plain Diff
Use atomic transaction
parent
e68ef488
No related branches found
No related tags found
1 merge request
!78
Resolve "Rewrite registration wizard"
Pipeline
#195973
passed
1 month ago
Stage: prepare
Stage: test
Stage: build
Stage: publish
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aleksis/apps/paweljong/schema/checkpoint.py
+1
-1
1 addition, 1 deletion
aleksis/apps/paweljong/schema/checkpoint.py
aleksis/apps/paweljong/schema/event_registration.py
+4
-0
4 additions, 0 deletions
aleksis/apps/paweljong/schema/event_registration.py
with
5 additions
and
1 deletion
aleksis/apps/paweljong/schema/checkpoint.py
+
1
−
1
View file @
073d0e2f
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/paweljong/schema/event_registration.py
+
4
−
0
View file @
073d0e2f
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
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment