BitByte-TPC / alumni

Alumni Portal for IIITDM Jabalpur
https://alumni.iiitdmj.ac.in
MIT License
15 stars 54 forks source link

Match state as well on the `/members/mapsearch/` endpoint. #126

Open garg3133 opened 8 months ago

garg3133 commented 8 months ago

On the above-mentioned endpoint, currently we only match the city (we get the 'search' query as city, state, country). This leads to discrepancies in the profiles shown on the result page because two cities at different places can have the same name.

So, along with 'city', we should filter on the basis of the 'state' as well.

Steps to reproduce the issue

Ritish134 commented 8 months ago

Can i take up this issue ??

garg3133 commented 8 months ago

Sure, go ahead!

Ritish134 commented 8 months ago

I am facing a issue that when I create an Alumni profile, it does not show up on at /members/ endpoint and by default there are 0 registered alumni .

So as to check the search functionality i need to create some alumni profiles ,am I missing anything as I am new to django . Could you please help !!

garg3133 commented 8 months ago

@Ritish134 You would need to first verify the profiles you've created by logging in as Admin, then only they'll appear on the /members/ page. Just login with your superuser credentials (you can create them by running python3 manage.py createsuperuser command if not done so already), go to Admin dashboard (by clicking on the "Admin" button on the top-right corner of home page) and verify those profiles.

garg3133 commented 8 months ago

Also, if you're creating the users using the Registration Form on the /newregister/ endpoint, please report any issues you come across there, as that is a new Registration Form that was just merged 2 days back.

Ritish134 commented 8 months ago

@Ritish134 You would need to first verify the profiles you've created by logging in as Admin, then only they'll appear on the /members/ page. Just login with your superuser credentials (you can create them by running python3 manage.py createsuperuser command if not done so already), go to Admin dashboard (by clicking on the "Admin" button on the top-right corner of home page) and verify those profiles.

Yes ,did that but after verifying the profile it gives an error NoReverseMatch at /members/ django_error e1

garg3133 commented 8 months ago

@Ritish134 It's giving error because you've saved incorrect values in the Batch table. The Batch table stores the passing year of alumni and must be 4 digits long (ex. 2022), whereas you've set the batch for the alumni in the above screenshot as '1'.

If you look closely at the error above, there's a regex there: [0-9]{4} which mean that the batch should be numeric and 4 digit long, which the argument being passed is (1,), i.e., '1'.

Ritish134 commented 8 months ago

Ooh yes got it thanks 😅

Ritish134 commented 8 months ago

How is it ? @garg3133 city-1 city

garg3133 commented 8 months ago

@Ritish134 This isn't what I was talking about (and I should have been more clear on the steps to reproduce the issue).

This issue is related to the /mapsearch/ endpoint. To reproduce the issue:

As for the changes you've done till now, while it looks good, we don't really need a 'state' input on the page to search for alumni. But while you're at it, maybe you can fix another issue on that page related to responsiveness.

This is how the page looks on mobile screens:

image

On small screens, each input should be in separate rows and wide enough for users to interact with them.

Maybe you can fix this in the current PR (as you are already working on that page) and the other issue in a separate PR?

garg3133 commented 8 months ago

Let me know if you face any further issues here. I've filed a separate issue for the responsiveness thing: #133.