@action(['post'], detail=False)
def reset_password_confirm(self, request, *args, **kwargs):
    serializer = self.get_serializer(data=request.data)
    serializer.is_valid(raise_exception=True)
    serializer.user.set_password(serializer.data['new_password'])
    if hasattr(serializer.user, 'last_login'):
        serializer.user.last_login = now()
    serializer.user.is_active = True
    serializer.user.save()
    if djoser_settings.PASSWORD_CHANGED_EMAIL_CONFIRMATION:
        context = {'user': serializer.user}
        to = [get_user_email(serializer.user)]
        djoser_settings.EMAIL.password_changed_confirmation(self.request, context).send(to)
    return Response(status=status.HTTP_204_NO_CONTENT)
@action(['post'], detail=False)
def reset_password_confirm(self, request, *args, **kwargs):
    serializer = self.get_serializer(data=request.data)
    serializer.is_valid(raise_exception=True)
    serializer.user.set_password(serializer.data['new_password'])
    if hasattr(serializer.user, 'last_login'):
        serializer.user.last_login = now()
    serializer.user.is_active = True
    serializer.user.save()
    if djoser_settings.PASSWORD_CHANGED_EMAIL_CONFIRMATION:
        context = {'user': serializer.user}
        to = [get_user_email(serializer.user)]
        djoser_settings.EMAIL.password_changed_confirmation(self.request, context).send(to)
    return Response(status=status.HTTP_204_NO_CONTENT)