Remove deprecated 'user.key' lookup for private key

merge-requests/130/head
Jason Robinson 2017-07-04 23:14:42 +03:00
rodzic 64b1c8c02e
commit ccf161a5d3
2 zmienionych plików z 2 dodań i 6 usunięć

Wyświetl plik

@ -9,6 +9,7 @@
### Removed
* `Post.photos` entity attribute was never used by any code and has been removed. Child entities of type `Image` are stored in the `Post._children` as before.
* Removed deprecated user private key lookup using `user.key` in Diaspora receive processing. Passed in `user` objects must now have a `private_key` attribute.
## [0.12.0] - 2017-05-22

Wyświetl plik

@ -78,12 +78,7 @@ class Protocol(BaseProtocol):
return self.sender_handle, self.content
def _get_user_key(self, user):
if not hasattr(self.user, "private_key") or not self.user.private_key:
if hasattr(self.user, "key") and self.user.key:
warnings.warn("Using `key` in user object for private key has been deprecated. Please "
"have available `private_key` instead. Usage of `key` will be removed after 0.8.0.",
DeprecationWarning)
return self.user.key
if not getattr(self.user, "private_key", None):
raise EncryptedMessageError("Cannot decrypt private message without user key")
return self.user.private_key