Skip to content

Conversation

@polyccon
Copy link

  • Adds function that reads names from a name_exceptions_csv file
  • Adds a check whether a name is in the file, if it fails the check in the does_member_name_looks_like_spam function

@polyccon polyccon force-pushed the Privacy-and-security branch from a6476f6 to 4d09a74 Compare July 14, 2019 13:41
@polyccon polyccon force-pushed the Privacy-and-security branch from 4d09a74 to 4008672 Compare July 14, 2019 14:14
logging.info(
"Bad Member name: {} (ID: {})".format(member_name, member_id)
)
if member_id in read_name_exceptions(name_exceptions_csv):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you want to move the call to read_name_exceptions outside the loop, otherwise the file will be re-read on every iteration.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! Wasn't sure how to run the code end-to-end, did run the tests and they were passing but I think there is some bug somewhere in how unittest is set up in virtualenv, can we rely on Travis ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed changes, but I need to see how to run the tests properly!

def read_name_exceptions(name_exceptions_csv):
""" Read member names from csv files"""
member_ids = []
with open(name_exceptions_csv, newline='') as name_exceptions:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a specific reason to disable translation of newlines?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really, I will remove it.

@polyccon polyccon force-pushed the Privacy-and-security branch 2 times, most recently from 62b45ee to 32779cd Compare July 20, 2019 17:07
@polyccon polyccon force-pushed the Privacy-and-security branch from 32779cd to d270c95 Compare July 20, 2019 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants