gathering / unicorn-backend

Backend/API for UNICORN
https://competitions.gathering.org
MIT License
2 stars 1 forks source link

Fix Achievement user filter to lookup by UUID #20

Closed niccofyren closed 2 years ago

niccofyren commented 2 years ago

While playing around with existing Achievement routes I stumbled upon this user filter that didn't quite work. The filter seems to expect a numeric ID and corresponding user id field, but looking at current user model/migrations there is only a uuid field present. Updated it to expect UUID values and use uuid field for lookup.

Example of previously broken lookup: /api/achievements/achievements/?user=c3961109-045c-43bd-a4d6-329209accddf (and providing "legacy" numeric id fails because of missing DB column)

Literally (as far as I can remember) my first PR to a Django project ever, so just trying to get my toes wet 😄