Skip to content

Remove duplicate in validations.md #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions extending/validations.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Validations

The main group of the user By default, Caluma assumes the first group in the list of groups it receives from the OIDC provider as the group the request was made in the name of. This means, this group will be written into the created\_by\_group field on the records that get created during the request. It is possible to manually set this group in the validation class, in order to override this behavior: from caluma.caluma\_core.validations import BaseValidation

class CustomValidation(BaseValidation): def validate(self, mutation, data, info): # the list of groups received from the OIDC provider can be accessed with # info.context.user.groups # Overriding the main group can be achieved by setting the `group` property on the user object: info.context.user.group = "foobar" return dataValidation classes can validate or amend input data of any mutation. Each mutation is processed in two steps:
Validation classes can validate or amend input data of any mutation. Each mutation is processed in two steps:

1. Permission classes check if a given mutation is allowed based on the object being mutated, and
2. Validation classes process (and potentially amend) input data of a given mutation
Expand Down