Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit 8cbee2a

Browse files
committed
Always set user_ctx in replication documents
1 parent ca1a71e commit 8cbee2a

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/cloudant/replicator.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ def create_replication(self, source_db=None, target_db=None,
5151
:param str repl_id: Optional replication id. Generated internally if
5252
not explicitly set.
5353
:param dict user_ctx: Optional user to act as. Composed internally
54-
if not explicitly set and not in CouchDB Admin Party
55-
mode.
54+
if not explicitly set.
5655
:param bool create_target: Specifies whether or not to
5756
create the target, if it does not already exist.
5857
:param bool continuous: If set to True then the replication will be
@@ -101,11 +100,9 @@ def create_replication(self, source_db=None, target_db=None,
101100

102101
# add user context delegation
103102

104-
if not data.get('user_ctx'):
105-
if target_db and target_db.admin_party:
106-
pass # noop - not required for admin party mode
107-
elif self.database.creds and self.database.creds.get('user_ctx'):
108-
data['user_ctx'] = self.database.creds['user_ctx']
103+
if not data.get('user_ctx') and self.database.creds and \
104+
self.database.creds.get('user_ctx'):
105+
data['user_ctx'] = self.database.creds['user_ctx']
109106

110107
return self.database.create_document(data, throw_on_exists=True)
111108

0 commit comments

Comments
 (0)