-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
fix: Allow organizer to override session form validation #7172
Conversation
complex_field_values = data.get('complex_field_values', 'absent') # Set default to 'absent' to differentiate between None and not sent | ||
is_absent = complex_field_values == 'absent' # True if values are not sent in data JSON | ||
is_same = data.get('complex_field_values') == session.complex_field_values # Using original value to ensure None instead of absent | ||
# We stop checking validations for organizers only if they may result in data change or absent. See test_session_forms_api.py for more info |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (147 > 90 characters)
app/api/sessions.py
Outdated
# We allow organizers and admins to edit session without validations | ||
complex_field_values = data.get('complex_field_values', 'absent') # Set default to 'absent' to differentiate between None and not sent | ||
is_absent = complex_field_values == 'absent' # True if values are not sent in data JSON | ||
is_same = data.get('complex_field_values') == session.complex_field_values # Using original value to ensure None instead of absent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at least two spaces before inline comment
line too long (138 > 90 characters)
app/api/sessions.py
Outdated
) | ||
# We allow organizers and admins to edit session without validations | ||
complex_field_values = data.get('complex_field_values', 'absent') # Set default to 'absent' to differentiate between None and not sent | ||
is_absent = complex_field_values == 'absent' # True if values are not sent in data JSON |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at least two spaces before inline comment
line too long (95 > 90 characters)
app/api/sessions.py
Outdated
'session', self.resource.schema, session, data | ||
) | ||
# We allow organizers and admins to edit session without validations | ||
complex_field_values = data.get('complex_field_values', 'absent') # Set default to 'absent' to differentiate between None and not sent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at least two spaces before inline comment
line too long (142 > 90 characters)
'data': { | ||
'type': 'session', | ||
'id': str(session.id), | ||
"attributes": {"state": "withdrawn",}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing whitespace after ','
Fixes #7164