Skip to content

Commit

Permalink
Closes #12, bug in repeatition of comments
Browse files Browse the repository at this point in the history
  • Loading branch information
OrkoHunter committed Jan 29, 2017
1 parent 105610b commit 36cc31a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pep8speaks/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import sys
import time
from flask import abort
from BeautifulSoup import BeautifulSoup
from markdown import markdown
import psycopg2
import pycodestyle
import requests
Expand Down Expand Up @@ -322,7 +324,10 @@ def comment_permission_check(data, comment):
if old_comment["user"]["id"] == 24736507: # ID of @pep8speaks
last_comment = old_comment["body"]
break
if comment == last_comment:

text1 = ''.join(BeautifulSoup(markdown(comment)).findAll(text=True))
text2 = ''.join(BeautifulSoup(markdown(last_comment)).findAll(text=True))
if text1 == text2:
PERMITTED_TO_COMMENT = False

## Do not comment on updating if no errors were introduced previously
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ psycopg2
PyYAML
unidiff
autopep8
markdown
BeautifulSoup

0 comments on commit 36cc31a

Please sign in to comment.