You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The application initialization script uses and import with a side effect. The app.validators module is imported, which uses the jsonschema.draft4_format_checker decorator. It has a side effect of globally registering the validation function. That itself is not a very good thing, but it’s how this external library behaves.
Moreover this all happens not when the app is created (by the create_app function), but when the app module is imported. That makes the app module import itself having a side effect. No no no.
Remove the decorator side effect
Remove the import side effect
The decorators can be resolved by using them as a plain function. It doesn’t modify the original function in any way, it just registers it in the module.
The application initialization script uses and import with a side effect. The app.validators module is imported, which uses the jsonschema.draft4_format_checker decorator. It has a side effect of globally registering the validation function. That itself is not a very good thing, but it’s how this external library behaves.
Moreover this all happens not when the app is created (by the create_app function), but when the app module is imported. That makes the app module import itself having a side effect. No no no.
The decorators can be resolved by using them as a plain function. It doesn’t modify the original function in any way, it just registers it in the module.
The text was updated successfully, but these errors were encountered: