-
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: non-organizer user can't set email null #7378
Conversation
Codecov Report
@@ Coverage Diff @@
## development #7378 +/- ##
============================================
Coverage 64.24% 64.24%
============================================
Files 259 259
Lines 13133 13136 +3
============================================
+ Hits 8437 8439 +2
- Misses 4696 4697 +1
Continue to review full report at Codecov.
|
app/api/speakers.py
Outdated
@@ -81,7 +81,13 @@ def before_post(self, args, kwargs, data=None): | |||
and not data.get('email') | |||
): | |||
data['email'] = current_user.email | |||
|
|||
if ( | |||
not has_access('is_organizer', event_id=data['event']) |
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.
has_access('is_organizer', event_id=data['event'])
is accessed already, so save it in a variable and reuse elsewhere
Co-authored-by: Areeb Jamal <[email protected]>
…y, so save it in a variable and reusing elsewhere
Co-authored-by: Areeb Jamal <[email protected]>
app/api/speakers.py
Outdated
@@ -75,13 +75,20 @@ def before_post(self, args, kwargs, data=None): | |||
{'pointer': 'data/attributes/is_email_overridden'}, | |||
'Organizer access required to override email', | |||
) | |||
is_organizer = has_access('is_organizer', event_id=data['event']) |
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.
Used above this condition as well
related: fossasia/open-event-frontend#5359
Checklist
development
branch.