-
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: Make attendee info editable only by admin or that user itself #7108
Conversation
Please add tests for the logic |
app/api/attendees.py
Outdated
|
||
if not (current_user.is_staff or current_user.id == order.user_id): | ||
raise ForbiddenError( | ||
{'source': ''}, 'Only admin or that user itself can update attendee 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.
{'source': ''} is useless. Provide better pointer or remove it altogether
Complexity increasing per file
==============================
- app/api/attendees.py 2
Clones added
============
- tests/all/integration/api/attendee/test_attendee_api.py 11
See the complete overview on Codacy |
@iamareebjamal Please review |
Codecov Report
@@ Coverage Diff @@
## development #7108 +/- ##
===============================================
+ Coverage 62.51% 62.53% +0.01%
===============================================
Files 262 262
Lines 13006 13008 +2
===============================================
+ Hits 8131 8134 +3
+ Misses 4875 4874 -1
Continue to review full report at Codecov.
|
Fixes #7104
Short description of what this resolves:
Right now anybody can edit attendee info which is not correct.
Changes proposed in this pull request:
Only admin or that user itself should be able to edit attendee's info.
Checklist
development
branch.