Flask-Discord
Flask-Discord copied to clipboard
Provide async views support
Provide support for Flask async views as outlined in https://flask.palletsprojects.com/en/2.0.x/async-await/
Theoretically it should be as easy as adding current_app.ensure_sync(func) to decorators, so I tried adding it myself, but I faced issues, which seemed to boil down to it working on the first loading of the site, but after any refresh or navigating to a different page with @requires_authorization the site would just crash.
Thanks!
I have this on my todo list and will try providing support for flask async-await soon. What you tried changing isn't enough. It will also require to make async requests using aiohttp. So, it will be somehow similar to quart-discord patch but for Flask.
Hmm... I see... Thanks!
If you still need the enhancement I made a PR here : https://github.com/weibeu/Flask-Discord/pull/72
That should fix at least the @requires_authorization