AdrianFerJ / v2go-api

V2go web app's repo contains client and server apps (django and angular), and infastructure setup for both apps, postgres, redis, and nginx using docker
0 stars 0 forks source link

Update query to retrive events using EV[], instead of user #92

Closed AdrianFerJ closed 5 years ago

AdrianFerJ commented 5 years ago

This PR Updates the my-accounts query (API view) to retrieve events based on the user's EVs instead of the User itself

This PR is related to the issue we had trying to display the events of a user. The reason was that EventsEV created from the frontend application didn't contain ev_owner. BUT I realized that it is redundant to pass the ev_owner (user) on top of the ev (because an EV always has an User, we can always find that information.. no need to pass it twice).

Note Initially I tried to remove the ev_owner field from the EventEv model, but it is being used in a bunch of different places. So, for now we will continue to have the bug (when we create a new eventEv from the web app it will not have an ev_owner... ). Refactoring this seems too costly right now, so I'll just create an issue about it.