Skip to content

Commit 6af32d6

Browse files
authored
Merge pull request InstaPy#4448 from dmfaria/master
fix issue when verifying mandatory words (issue InstaPy#4444)
2 parents febb76f + af18006 commit 6af32d6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ _The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
2323
- 'Failed to get comments' issue
2424
- Threaded session ending with exception `ValueError: signal only works in main thread`
2525
- `like_image` in dev has this arg
26+
- Verifying mandatory words when the script can not get post description
2627

2728

2829
## [0.4.3] - 2019-05-15

instapy/comment_util.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def verify_commenting(browser, max, min, mand_words, logger):
122122
return False, disapproval_reason
123123

124124
comments_count, msg = get_comments_count(browser, logger)
125-
if not comments_count:
125+
if comments_count is None:
126126
disapproval_reason = "--> Not commenting! {}".format(msg)
127127
return False, disapproval_reason
128128

@@ -168,6 +168,8 @@ def verify_commenting(browser, max, min, mand_words, logger):
168168
mand_word.lower() in first_comment for
169169
mand_word in mand_words))):
170170
return False, 'mandantory words not in post desc'
171+
if (post_desc is None and first_comment is None):
172+
return False, "couldn't get post description and comments"
171173

172174
return True, 'Approval'
173175

0 commit comments

Comments
 (0)