(self)
return HTTP_STATUS_CODE_OK
Handles POST request to the resource.

        Returns:
            HTTP status code indicating whether operation was sucessful.
Handles POST request to the resource.
Handles POST request to the resource .
def post(self):
        """Handles POST request to the resource.

        Returns:
            HTTP status code indicating whether operation was sucessful.
        """
        form = request.json
        if not form:
            form = request.data

        password = form.get('password', '')

        if not password:
            abort(
                HTTP_STATUS_CODE_NOT_FOUND,
                'No password supplied, unable to change the password.')

        if not isinstance(password, str):
            abort(
                HTTP_STATUS_CODE_FORBIDDEN,
                'Password needs to be a string.')

        current_user.set_password(plaintext=password)
        db_session.add(current_user)
        db_session.commit()
        return HTTP_STATUS_CODE_OK
def post ( self ) : form = request . json if not form : form = request . data password = form . get ( 'password' , '' ) if not password : abort ( HTTP_STATUS_CODE_NOT_FOUND , 'No password supplied, unable to change the password.' ) if not isinstance ( password , str ) : abort ( HTTP_STATUS_CODE_FORBIDDEN , 'Password needs to be a string.' ) current_user . set_password ( plaintext = password ) db_session . add ( current_user ) db_session . commit ( ) return HTTP_STATUS_CODE_OK