kopia lustrzana https://gitlab.com/jaywink/federation
Remove unnecessary 'protocol' parameter from retrieve_remote_profile
We're miles away from including other protocols and ideally the caller shouldn't have to pass in the protocol anyway.merge-requests/130/head
rodzic
ae717aefa8
commit
64839a9d81
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
### Backwards incompatible changes
|
||||
* `federation.utils.diaspora.retrieve_and_parse_profile` will now return `None` if the `Profile` retrieved doesn't validate. This will affect also the output of `federation.fetchers.retrieve_remote_profile` which is the high level function to retrieve profiles.
|
||||
* Remove unnecessary `protocol` parameter from `federation.fetchers.retrieve_remote_profile`. We're miles away from including other protocols and ideally the caller shouldn't have to pass in the protocol anyway.
|
||||
|
||||
### Added
|
||||
* Added `Retraction` entity with `DiasporaRetraction` counterpart.
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import importlib
|
||||
import warnings
|
||||
|
||||
|
||||
def retrieve_remote_profile(handle, protocol=None):
|
||||
def retrieve_remote_profile(handle):
|
||||
"""High level retrieve profile method.
|
||||
|
||||
Retrieve the profile from a remote location, using either the given protocol or by checking each
|
||||
|
|
@ -17,9 +16,6 @@ def retrieve_remote_profile(handle, protocol=None):
|
|||
Returns:
|
||||
Profile or None
|
||||
"""
|
||||
if protocol:
|
||||
warnings.warn("Currently retrieve_remote_profile doesn't use the protocol argument. Diaspora protocol"
|
||||
"will always be used.")
|
||||
protocol_name = "diaspora"
|
||||
utils = importlib.import_module("federation.utils.%s" % protocol_name)
|
||||
return utils.retrieve_and_parse_profile(handle)
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue