pycon.tw
pycon.tw copied to clipboard
fix(proposal): 404 error for co-speaker
Types of changes
Thanks for sending a pull request! Please fill in the following content to let us know better about this change.
Please put an x
in the box that applies
- [x] Bugfix
- [ ] New feature
- [ ] Refactoring
- [ ] Breaking change (any change that would cause existing functionality to not work as expected)
- [ ] Documentation Update
- [ ] Other (please describe)
Description
Resolve 404 error and strange style of table after co-speaker pressed accept/decline during reviewing stage, which "SLUG.proposals.editable" is false.
Steps to Test This Pull Request
Steps to reproduce the behavior:
- Create 2 users: main speaker A and co speaker B.
- Go to Django admin and set to cfp stage as doc
- Sign in as speaker A into http://localhost:8000/en-us/dashboard/ and create a new proposal
- Go to Django admin and set to review stage.
- Found the proposal from speaker A and add B in "Additional Speakers" table.
- Sign in as speaker B into http://localhost:8000/en-us/dashboard/ and press "accept" and "decline" on the request.
- See error if page 404 shows up.
Expected behavior
404 happened in Step[7] disappear.
More Information
Screenshots
@mattwang44 uncertain if it's a good solution: When I simply remove if/else statement in the dispatch function, 404 no longer shows up(of course) while speaker A remains unaffected(Did I miss anything?)
記得修改 test cases
記得修改 test cases
賀! 研究中
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 73.99%. Comparing base (
fca6fd2
) to head (a018685
). Report is 46 commits behind head on master.
:exclamation: Current head a018685 differs from pull request most recent head 6a6c2d5
Please upload reports for the commit 6a6c2d5 to get more accurate results.
Additional details and impacted files
@@ Coverage Diff @@
## master #1188 +/- ##
==========================================
+ Coverage 71.19% 73.99% +2.79%
==========================================
Files 84 81 -3
Lines 3451 3057 -394
==========================================
- Hits 2457 2262 -195
+ Misses 994 795 -199
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@mattwang44 I thought “request” can be one of parameters to switch the edit status and check if additional speaker is allowed to update/cancel the form during uneditable time.
...seems like “request” is not included in these two forms. (Based on the par “request” came from “RequestUserValidationMixin”, which is not indcluded in “AdditionalSpeakerUpdateForm”.)
What is the key par should I consider?
@mattwang44 跟GPT協作找到了一個方法是用RequestFactory來測試: https://docs.djangoproject.com/en/5.0/topics/testing/advanced/ 見commit54bf911