matching query does not exist Error in Django

后端 未结 6 587
情歌与酒
情歌与酒 2020-11-29 20:35

I have implemented a password recovery functionality in django. With my method, the new password will be sent to the email id entered. It works fine when given the correct e

6条回答
  •  温柔的废话
    2020-11-29 20:49

    You may try this way. just use a function to get your object

    def get_object(self, id):
        try:
            return UniversityDetails.objects.get(email__exact=email)
        except UniversityDetails.DoesNotExist:
            return False
    

提交回复
热议问题