[Fixed]-Use django model to get db information from json request

1👍

If I understand well, you want to retrieve the user object associated with the email sent in request body:

as_user = models.User.objects.get(email=data['asUser'])

That will raise an models.User.DoesNotExist exception if email can not be found.

Leave a comment