Hack-WashU / myhackwashu

✏️ Registration for HackWashU
https://hackwashu.com
MIT License
5 stars 5 forks source link

Solving Issue #11 #25

Closed eddiechoi00 closed 2 years ago

eddiechoi00 commented 2 years ago

Patch Notes

Addressing Issue #11; if the user uses @wustl.edu, the option for live or online will appear. If the user does not use a @wustl.edu email, then a confirmation checkbox will appear acknowledging that non-WashU students will only be able to attend the event online.

Additional Notes (optional)

I may have made some unnecessary changes to make this work, please call me out if I did. Also had trouble getting the live or online options horizontally instead of vertically; looks like all the other sections are grouped under a <style> head, but couldn't really figure out a way to fit the new ID I created into that. It's a very minor thing just for the aesthetics, but if it's an easy fix, I think it'll be worth it.

Screen Shot 2022-07-03 at 5 02 21 PM Screen Shot 2022-07-03 at 5 02 31 PM
jackheuberger commented 2 years ago

I don't have time to review tonight but will take a look tomorrow. Did you by any chance see user/model.py? What I did when I took a crack at this one was adding a new function to the user class called is_wustl that returned true if the email contained @wustl.edu or not

eddiechoi00 commented 2 years ago

That's kinda what I did, the unnecessary changes I was talking about was to call the current user's email from views.py.

The css part I was talking about is pretty much neglectable if you don't mind how it looks.

jackheuberger commented 2 years ago

I was able to get the is_wustl field updating properly on user creation. Are you able to make changes to the user_wustl branch in this repo? I don't think it should be protected.

How were you able to pass the is_wustl data to the form?

eddiechoi00 commented 2 years ago

I wasn't aware about the is_wustl field before, so I ended up making a request for the user on views.py and feeding it into forms.py as a parameter on the classes. We can't make a request on forms.py so I had to do it through views.py.

I can't check right now if I can make changes to the user_wustl branch but I will when I get the chance.

jackheuberger commented 2 years ago

Maybe it has something to do with two different forms existing? It's an error with the form being valid, maybe an error with the live/online question not being included in the form for non-wustl people? Maybe that question isn't being rendered, but the server still expects a response for it.

Tbh I have no clue, but that's my first guess. Lmk if you need help and I can take a look tomorrow