Skip to content
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 add speaker without email #5359

Merged
merged 2 commits into from
Oct 26, 2020
Merged

fix: Allow organizer to add speaker without email #5359

merged 2 commits into from
Oct 26, 2020

Conversation

maze-runnar
Copy link
Contributor

Fixes #5342

Checklist

  • I have read the Contribution & Best practices Guide.
  • My branch is up-to-date with the Upstream development branch.
  • The acceptance, integration, unit tests and linter pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@vercel
Copy link

vercel bot commented Oct 23, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/eventyay/open-event-frontend/cp7kkkfkq
✅ Preview: https://open-event-frontend-git-adding-email.eventyay.vercel.app

@codecov
Copy link

codecov bot commented Oct 23, 2020

Codecov Report

Merging #5359 into development will not change coverage.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##           development    #5359   +/-   ##
============================================
  Coverage        22.78%   22.78%           
============================================
  Files              491      491           
  Lines             5245     5245           
  Branches            37       37           
============================================
  Hits              1195     1195           
  Misses            4045     4045           
  Partials             5        5           
Impacted Files Coverage Δ
app/controllers/events/view/speakers/create.js 0.00% <0.00%> (ø)
app/controllers/events/view/speakers/edit.js 0.00% <0.00%> (ø)
app/components/tabbed-navigation.js 33.33% <0.00%> (-20.00%) ⬇️
app/controllers/public/index.js 6.34% <0.00%> (ø)
app/components/public/ticket-list.js 20.18% <0.00%> (ø)
app/controllers/admin/content/events.js 0.00% <0.00%> (ø)
app/controllers/events/view/sessions/list.js 0.00% <0.00%> (ø)
.../controllers/events/view/tickets/attendees/list.js 0.00% <0.00%> (ø)
app/models/event.js 50.00% <0.00%> (+18.75%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 63929e3...9619905. Read the comment docs.

@@ -11,7 +11,7 @@ export default class extends Controller {
}
const newSpeaker = this.model.speaker;
if (newSpeaker.isEmailOverridden) {
newSpeaker.set('email', this.authManager.currentUser.email);
newSpeaker.set('email', 'Not Provided');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that is wrong data

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what should be put here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

null

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I am setting it to null it throws err - the server responded with a status of 422 ()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Server needs to allow null emails in case organizers or admin create the speaker

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after allowing null from server and adding null here, it is not being null, It sets to user email on writing newSpeaker.set('email', null); . But on writingnewSpeaker.set('email', ' any text');the email is set to that text.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding null it is setting it to owner email , but if it's not null then setting to that text
scrnli_10_23_2020_8-44-05 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is happening because of this on server side :

elif (
            data.get('is_email_overridden')
            and has_access('is_organizer', event_id=data['event'])
            and not data.get('email')
        ):
            data['email'] = current_user.email

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What to do here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will check why this code was added.

@iamareebjamal
Copy link
Member

@maze-runnar One condition is still left. If a non-organizer user sets email to null, it should be denied

Copy link
Member

Codacy Here is an overview of what got changed by this pull request:

Complexity increasing per file
==============================
- app/controllers/events/view/speakers/create.js  5
         

See the complete overview on Codacy

@iamareebjamal iamareebjamal changed the title fix: Adding speaker without email fix: Allow organizer to add speaker without email Oct 26, 2020
@iamareebjamal iamareebjamal merged commit 141a67f into fossasia:development Oct 26, 2020
@maze-runnar maze-runnar deleted the adding-email branch October 26, 2020 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Organizer: Adding speaker without email results in sessions added to "my sessions" from organizer him/herself
3 participants