geosolutions-it / smb-portal

SaveMyByke portal
https://waffle.io/geosolutions-it/smb-portal
1 stars 3 forks source link

my-user API endpoint now allows updating user fields #155

Closed ricardogsilva closed 6 years ago

ricardogsilva commented 6 years ago

This PR allows the /api/my-user endpoint to be used for updating a user's fields.

It is now possible to use the following workflow:

Creating/updating the user's profile via the API may be done with a request like the following:

PATCH /api/my-user
{
  "accepted_terms_of_service": true,
  "profile": {
    "gender": "female",
    "occupation": "manager",
    "age": "30 - 65"
  }
}

Implementation details

Upon receiving a request to update a profile for a user that does not exist yet on django, the code proceeds to:

fixes #153