Mercurial > libervia-backend
diff libervia/backend/plugins/plugin_misc_account.py @ 4341:e9971a4b0627
remove uses of twisted.internet.defer.returnValue
This function has been deprecated in Twisted 24.7.0.
author | Povilas Kanapickas <povilas@radix.lt> |
---|---|
date | Wed, 11 Dec 2024 01:17:09 +0200 |
parents | 0d7bb4df2343 |
children |
line wrap: on
line diff
--- a/libervia/backend/plugins/plugin_misc_account.py Tue Dec 03 00:53:18 2024 +0100 +++ b/libervia/backend/plugins/plugin_misc_account.py Wed Dec 11 01:17:09 2024 +0200 @@ -425,7 +425,7 @@ @defer.inlineCallbacks def verify(attempt): auth = yield PasswordHasher.verify(attempt, sat_cipher) - defer.returnValue(auth) + return auth def error_ui(message=None): if not message: @@ -443,8 +443,8 @@ verified = yield verify(delete_passwd) assert isinstance(verified, bool) if verified: - defer.returnValue(self.__delete_account(profile)) - defer.returnValue(error_ui()) + return self.__delete_account(profile) + return error_ui() # check for blog posts deletion if 'GROUPBLOG' in self.host.plugins: @@ -457,8 +457,8 @@ verified = yield verify(delete_posts_passwd) assert isinstance(verified, bool) if verified: - defer.returnValue(self.__delete_blog_posts(posts, comments, profile)) - defer.returnValue(error_ui()) + return self.__delete_blog_posts(posts, comments, profile) + return error_ui() """ # check for password modification @@ -471,16 +471,14 @@ if verified: if new_passwd1 == new_passwd2: data = yield self.__change_password(new_passwd1, profile=profile) - defer.returnValue(data) + return data else: - defer.returnValue( - error_ui( - D_("The values entered for the new password are not equal.") - ) + return error_ui( + D_("The values entered for the new password are not equal.") ) - defer.returnValue(error_ui()) + return error_ui() - defer.returnValue({}) + return {} def __change_password(self, password, profile): """Ask for a confirmation before changing the XMPP account and SàT profile passwords.