@@ -174,25 +174,26 @@ def create_instructor_answer(self, post, content, revision, anonymous=False):
174174 return self ._rpc .content_instructor_answer (params )
175175
176176 def mark_as_duplicate (self , duplicated_cid , master_cid , msg = '' ):
177- """Mark the post at DUPLICATED_CID as a duplicate of MASTER_CID
177+ """Mark the post at ``duplicated_cid`` as a duplicate of ``master_cid``
178178
179179 :type duplicated_cid: int
180180 :param duplicated_cid: The numeric id of the duplicated post
181181 :type master_cid: int
182182 :param master_cid: The numeric id of an older post. This will be the
183- post that gets kept and DUPLICATED_CID post will be concatinated
184- as a follow up to MASTER_CID post.
185- :returns True if it is successful. False otherwise
183+ post that gets kept and ``duplicated_cid`` post will be concatinated
184+ as a follow up to ``master_cid`` post.
185+ :type msg: string
186+ :param msg: the optional message (or reason for marking as duplicate)
187+ :returns: True if it is successful. False otherwise
186188 """
187- try :
188- content_id_from = self .get_post (duplicated_cid )['id' ]
189- content_id_to = self .get_post (master_cid )['id' ]
190- except :
191- return False
192- params = {'cid_dupe' : content_id_from ,
193- 'cid_to' : content_id_to ,
194- 'msg' : msg }
195- return self ._rpc .content_mark_duplicate (params ) == 'OK'
189+ content_id_from = self .get_post (duplicated_cid )["id" ]
190+ content_id_to = self .get_post (master_cid )["id" ]
191+ params = {
192+ "cid_dupe" : content_id_from ,
193+ "cid_to" : content_id_to ,
194+ "msg" : msg
195+ }
196+ return self ._rpc .content_mark_duplicate (params )
196197
197198 #########
198199 # Users #
0 commit comments