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: duplicate registration on hackathon onboarding #7290

Conversation

walidmujahid
Copy link
Contributor

To prevent duplicate hackathon registrations under an event:

  • return error on POST to /register_hackathon/ if user already registerd
  • if no poll on hackathon onboard page, disable 'Join Now' button on click
  • if poll on hackathon onboard page, disable poll submit button on click

fixes #7070

- return error on POST to /register_hackathon/ if user already registerd
- if no poll, disable 'Join Now' button on hackathon onboard page on click
- if poll, disable poll submit button on click
@walidmujahid walidmujahid force-pushed the hackathon-registeration-duplicate-registration-bug branch from 2c86e42 to 1aeae6f Compare August 26, 2020 10:27
@codecov
Copy link

codecov bot commented Aug 26, 2020

Codecov Report

Merging #7290 into master will increase coverage by 0.01%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7290      +/-   ##
==========================================
+ Coverage   26.10%   26.12%   +0.01%     
==========================================
  Files         300      300              
  Lines       29698    29700       +2     
  Branches     4409     4410       +1     
==========================================
+ Hits         7752     7758       +6     
+ Misses      21674    21670       -4     
  Partials      272      272              
Impacted Files Coverage Δ
app/dashboard/views.py 10.42% <0.00%> (-0.01%) ⬇️
app/dashboard/embed.py 31.60% <0.00%> (+3.44%) ⬆️

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 c8678da...1aeae6f. Read the comment docs.

@thelostone-mc thelostone-mc merged commit 1ad589e into gitcoinco:master Aug 27, 2020
@octavioamu
Copy link
Contributor

@walidmujahid notice you are just adding a disable class not actually disabling the button + if the request fails should "reenable" the button.

@walidmujahid
Copy link
Contributor Author

Thinking back on how I did this, the click event is still running. I should have probably just set a conditional and exited -and added the class for possibly UX. Sorry for the trouble @octavioamu, I should have noticed the error before it was merged. I will try to get a fix out later today.

@octavioamu
Copy link
Contributor

No problem just add attr disabled I stead of class and remove it on error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

^register_hackathon/ endpoint should validate whether a user has already registered for a event
3 participants