flask-restless icon indicating copy to clipboard operation
flask-restless copied to clipboard

It's better to throw exception when apply function to a unsupported preprocessor type

Open elvestar opened this issue 8 years ago • 1 comments

"PUT_SINGLE" is a preprocessor type, bug "PUT" is not a a preprocessor type. If flask-restless throw exception when using "PUT", users will quickly know why their pre_put() not be excuted.

api_manager.create_api(Persion, methods=['GET', 'POST', 'PUT'],
                   preprocessors={
                       'PUT': [pre_put],
                   })

elvestar avatar Apr 23 '16 05:04 elvestar

(Note that in the latest version, this becomes PATCH_RESOURCE.)

This is probably a good, user-friendly idea.

jfinkels avatar Apr 25 '16 17:04 jfinkels