Skip to content

Commit ac01613

Browse files
author
konstantina
committed
Updated function that handles Disqus library comments.
Added control whether a library has examples or not in order for Disqus to generate the correct comment.
1 parent 9046f0f commit ac01613

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

codebender_testing/disqus.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def update_comment(self, sketch, results, current_date, log_entry, openFailFlag,
8888

8989
return log_entry
9090

91-
def handle_library_comment(self, library, current_date, log):
91+
def handle_library_comment(self, library, current_date, log, examples=True):
9292
url = '/library/' + library
9393
identifier = 'ident:' + url
9494

@@ -110,7 +110,10 @@ def handle_library_comment(self, library, current_date, log):
110110
thread=identifier)
111111
if paginator:
112112
comment_updated = False
113-
new_message = self.messages['library'].replace('TEST_DATE', current_date)
113+
if examples==False:
114+
new_message = self.messages['library_no_examples'].replace('TEST_DATE', current_date)
115+
else:
116+
new_message = self.messages['library'].replace('TEST_DATE', current_date)
114117

115118
for thread in paginator:
116119

0 commit comments

Comments
 (0)