huskar_api/api/user.py
def post(self, username):
        """Resets password of specified user.

        If you request this API without the optional ``token`` argument, the
        specified user will receive a validation email which contains a token.
        The token will expire in ten minutes.

        Once you request this API again with the valid token, the password of
        specified user will be reset into the new one you provided.

        :param username: The username of specified user.
        :form token: Optional. The token contained in the validation email.
        :form password: Optional. The new password you request to set.
        :status 200: The request is successful. The ``{"email": "..."}`` will
                     be responded while requesting to reset password. If the
                     value is ``null`` then you can not reset password of this
                     user without help of administrators.
        """
        token = request.form.get('token', type=uuid.UUID)
        if token:
            new_password = request.form['password']
            user = reset_password(username, token, new_password)
            audit_log.emit(audit_log.types.CHANGE_USER_PASSWORD, user=user)
            return api_response()
        else:
            user, _ = request_to_reset_password(username)
            audit_log.emit(audit_log.types.FORGOT_USER_PASSWORD, user=user)
            return api_response({'email': user.email})
Resets password of specified user.

        If you request this API without the optional ``token`` argument, the
        specified user will receive a validation email which contains a token.
        The token will expire in ten minutes.

        Once you request this API again with the valid token, the password of
        specified user will be reset into the new one you provided.

        :param username: The username of specified user.
        :form token: Optional. The token contained in the validation email.
        :form password: Optional. The new password you request to set.
        :status 200: The request is successful. The ``{"email": "..."}`` will
                     be responded while requesting to reset password. If the
                     value is ``null`` then you can not reset password of this
                     user without help of administrators.
        
Resets password of specified user.
If you request this API without the optional ``token`` argument, the
specified user will receive a validation email which contains a token.
The token will expire in ten minutes.

Once you request this API again with the valid token, the password of
specified user will be reset into the new one you provided.
Resets password of specified user . If you request this API without the optional ` ` token ` ` argument the specified user will receive a validation email which contains a token . The token will expire in ten minutes . Once you request this API again with the valid token the password of specified user will be reset into the new one you provided .
def post(self, username):
        token = request.form.get('token', type=uuid.UUID)
        if token:
            new_password = request.form['password']
            user = reset_password(username, token, new_password)
            audit_log.emit(audit_log.types.CHANGE_USER_PASSWORD, user=user)
            return api_response()
        else:
            user, _ = request_to_reset_password(username)
            audit_log.emit(audit_log.types.FORGOT_USER_PASSWORD, user=user)
            return api_response({'email': user.email})
def post ( self , username ) : token = request . form . get ( 'token' , type = uuid . UUID ) if token : new_password = request . form [ 'password' ] user = reset_password ( username , token , new_password ) audit_log . emit ( audit_log . types . CHANGE_USER_PASSWORD , user = user ) return api_response ( ) else : user , _ = request_to_reset_password ( username ) audit_log . emit ( audit_log . types . FORGOT_USER_PASSWORD , user = user ) return api_response ( { 'email' : user . email } )
Resets password of specified user.
Resets password of specified user .
"""Resets password of specified user.

        If you request this API without the optional ``token`` argument, the
        specified user will receive a validation email which contains a token.
        The token will expire in ten minutes.

        Once you request this API again with the valid token, the password of
        specified user will be reset into the new one you provided.

        :param username: The username of specified user.
        :form token: Optional. The token contained in the validation email.
        :form password: Optional. The new password you request to set.
        :status 200: The request is successful. The ``{"email": "..."}`` will
                     be responded while requesting to reset password. If the
                     value is ``null`` then you can not reset password of this
                     user without help of administrators.
        """
self
username
The username of specified user.
The username of specified user .
form
Optional. The token contained in the validation email.
Optional . The token contained in the validation email .
form
Optional. The new password you request to set.
Optional . The new password you request to set .
status
The request is successful. The ``{"email": "..."}`` will
be responded while requesting to reset password. If the
value is ``null`` then you can not reset password of this
user without help of administrators.
The request is successful . The ` ` { " email " : " ... " } ` ` will be responded while requesting to reset password . If the value is ` ` null ` ` then you can not reset password of this user without help of administrators .