-
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
feat: Add session state transition validation #7156
Conversation
assert json.loads(response.data) == { | ||
'errors': [ | ||
{ | ||
'detail': f'You cannot change a session state from "{state}" to "{new_state}"', |
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 (99 > 90 characters)
owner = new_user | ||
creator = user | ||
session = SessionSubFactory(creator_id=creator.id, **kwargs) | ||
role, _ = get_or_create(Role, name='owner', title_name='Owner') |
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.
Black would make changes.
except KeyError: | ||
raise ForbiddenError( | ||
{'pointer': '/data/attributes/state'}, | ||
f'You cannot change a session state from "{session.state}" to "{new_state}"', |
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 (97 > 90 characters)
Complexity increasing per file
==============================
- tests/all/integration/api/session/test_session_state_api.py 7
Complexity decreasing per file
==============================
+ app/api/schema/sessions.py -3
See the complete overview on Codacy |
Codecov Report
@@ Coverage Diff @@
## development #7156 +/- ##
===============================================
+ Coverage 62.73% 62.84% +0.11%
===============================================
Files 262 262
Lines 13046 13055 +9
===============================================
+ Hits 8184 8205 +21
+ Misses 4862 4850 -12
Continue to review full report at Codecov.
|
Fixes #7149