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

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

Open
garg3133 opened this issue Jan 8, 2024 · 11 comments
Open

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

garg3133 opened this issue Jan 8, 2024 · 11 comments
Assignees
Labels
django good first issue Good for newcomers

Comments

@garg3133
Copy link
Member

garg3133 commented Jan 8, 2024

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

  • Create two alumni profiles with same city names but different states (ex. Hamirpur is in both HP and UP, Aurangabad is in both Bihar and Maharashtra).
  • Go to localhost:8000/geolocation page, zoom in to the city you just created the profile with at any one of the states, and click on it to go to the /members/mapseach page.
  • You'll see that the list contains profiles from other states as well (but with same city name).
@garg3133 garg3133 added good first issue Good for newcomers django labels Jan 8, 2024
@Ritish134
Copy link

Can i take up this issue ??

@garg3133
Copy link
Member Author

Sure, go ahead!

@Ritish134
Copy link

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
Copy link
Member Author

@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
Copy link
Member Author

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
Copy link

@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
Copy link
Member Author

@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
Copy link

Ooh yes got it thanks 😅

@Ritish134
Copy link

Ritish134 commented Jan 16, 2024

How is it ? @garg3133
city-1
city

@garg3133
Copy link
Member Author

@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:

  • Create two alumni profiles with same city names but different states (ex. Hamirpur is in both HP and UP, Aurangabad is in both Bihar and Maharashtra).
  • Go to localhost:8000/geolocation page, zoom in to the city you just created the profile with at any one of the states, and click on it to go to the /members/mapseach page.
  • You'll see that the list contains profiles from other states as well (but with same city name).

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
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
django good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants