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: Make speaker email nullable #7469

Merged
merged 5 commits into from
Dec 2, 2020
Merged

fix: Make speaker email nullable #7469

merged 5 commits into from
Dec 2, 2020

Conversation

maze-runnar
Copy link
Contributor

related fossasia/open-event-frontend#5751
Fixes fossasia/open-event-frontend#5342

Checklist

  • I have read the Contribution & Best practices Guide and my PR follows them.
  • My branch is up-to-date with the Upstream development branch.
  • The unit tests 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)
  • All the functions created/modified in this PR contain relevant docstrings.

@maze-runnar
Copy link
Contributor Author

@iamareebjamal i have set email field to allow null but its still showing
{"errors": [{"status": 422, "source": {"pointer": "/data/attributes"}, "title": "Unprocessable Entity", "detail": "Missing required fields ['email']"}], "jsonapi": {"version": "1.0"}}
in frontend.

@iamareebjamal
Copy link
Member

You didn't change schema

@maze-runnar
Copy link
Contributor Author

You didn't change schema

email = fields.Str(allow_none=True) it is already there in schema

@iamareebjamal
Copy link
Member

Please paste the request being sent to the server

@codecov
Copy link

codecov bot commented Nov 26, 2020

Codecov Report

Merging #7469 (334ad08) into development (5e3e8ae) will increase coverage by 0.06%.
The diff coverage is 100.00%.

Impacted file tree graph

@@               Coverage Diff               @@
##           development    #7469      +/-   ##
===============================================
+ Coverage        65.38%   65.44%   +0.06%     
===============================================
  Files              265      265              
  Lines            13256    13263       +7     
===============================================
+ Hits              8667     8680      +13     
+ Misses            4589     4583       -6     
Impacted Files Coverage Δ
app/api/helpers/custom_forms.py 100.00% <100.00%> (ø)
app/api/speakers.py 75.00% <100.00%> (+6.42%) ⬆️
app/models/speaker.py 97.61% <100.00%> (ø)
app/api/helpers/permission_manager.py 64.01% <0.00%> (+0.34%) ⬆️

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 5e3e8ae...334ad08. Read the comment docs.

@maze-runnar
Copy link
Contributor Author

Please paste the request being sent to the server

{"data":{"attributes":{"name":"name_of_speaker","email":null,"photo-url":null,"thumbnail-image-url":null,"icon-image-url":null,"small-image-url":null,"short-biography":"","long-biography":null,"speaking-experience":null,"mobile":null,"location":null,"website":null,"twitter":null,"facebook":null,"github":null,"linkedin":null,"instagram":null,"organisation":"org","is-featured":false,"is-email-overridden":true,"position":"pos","country":null,"city":null,"gender":null,"heard-from":null,"complex-field-values":{}},"relationships":{"user":{"data":{"type":"user","id":"1"}},"event":{"data":{"type":"event","id":"3"}}},"type":"speaker"}}

@iamareebjamal
Copy link
Member

It should work. Try required=False in schema as well

@maze-runnar
Copy link
Contributor Author

ok

@maze-runnar
Copy link
Contributor Author

email = fields.Str(allow_none=True, required=False) but Not working again.

@iamareebjamal
Copy link
Member

Are you sure you are submitting to local server and not production?

@maze-runnar
Copy link
Contributor Author

yes

@iamareebjamal
Copy link
Member

OK, please check other issues for now. I'll test this later

@maze-runnar
Copy link
Contributor Author

maze-runnar commented Dec 2, 2020

OK, please check other issues for now. I'll test this later

@iamareebjamal what's next here?

@iamareebjamal
Copy link
Member

I have fixed it. Pushing soon after writing tests

@iamareebjamal iamareebjamal changed the title wip: speaker email can be null fix: speaker email can be null Dec 2, 2020
@auto-label auto-label bot added the fix label Dec 2, 2020
@iamareebjamal
Copy link
Member

@maze-runnar Please test that everything is working

@maze-runnar
Copy link
Contributor Author

@maze-runnar Please test that everything is working

ok

@maze-runnar
Copy link
Contributor Author

@iamareebjamal it's working now. But When I included changes of fossasia/open-event-frontend#5751. It is showing
{"errors": [{"status": 422, "source": {"pointer": "/data/attributes"}, "title": "Unprocessable Entity", "detail": "Missing required fields ['email']"}], "jsonapi": {"version": "1.0"}}

@iamareebjamal
Copy link
Member

iamareebjamal commented Dec 2, 2020

Yes, it is due to email being required in custom forms. Fixing

@iamareebjamal
Copy link
Member

Please check now

@iamareebjamal
Copy link
Member

@maze-runnar .

@iamareebjamal iamareebjamal changed the title fix: speaker email can be null fix: Make speaker email nullable Dec 2, 2020
@iamareebjamal iamareebjamal merged commit fcaf432 into fossasia:development Dec 2, 2020
@maze-runnar
Copy link
Contributor Author

it's working correctly.

@maze-runnar maze-runnar deleted the speaker-email branch December 2, 2020 14:16
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
2 participants