# Add async support for AbstractBaseUser.check\_password()

**URL:** <https://forum.djangoproject.com/t/add-async-support-for-abstractbaseuser-check-password/20364>\
**Category:** Async\
**Created:** [April 19, 2023, 5:25am UTC](https://forum.djangoproject.com/t/add-async-support-for-abstractbaseuser-check-password/20364 "2023-04-19T05:25:36Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![HappyDingning](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/happydingning/32/13219_2.png) [@HappyDingning](https://forum.djangoproject.com/u/HappyDingning)\
**Post date:** [April 19, 2023, 5:25am UTC](https://forum.djangoproject.com/t/add-async-support-for-abstractbaseuser-check-password/20364/1 "2023-04-19T05:25:36Z")

</div>

When settings.PASSWORD\_HASHERS is changed and user.check\_password() is called in an async context, a SynchronousOnlyOperation exception may occur.

The reason is that the check\_password function will call the synchronous setter function to update the password field of the user table when the settings.PASSWORD\_HASHERS change.

I think this exception can be solved by defining async acheck\_password and defining async asetter function in acheck\_password. So that in an async context, user.acheck\_password() can be called to avoid the above exception.

If this solution is feasible, I am willing to contribute code.

 ![exception](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/2X/3/3e84d176eeac8c0d1a7162ae206e30c104061c9b.png)

---

_[View the full topic](https://forum.djangoproject.com/t/add-async-support-for-abstractbaseuser-check-password/20364)._
