Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Privacy and security - Part I #5

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

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

logging.info(
"Bad Member name: {} (ID: {})".format(member_name, member_id)
)
if member_id in read_name_exceptions(name_exceptions_csv):
Copy link

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

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
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.

None yet

2 participants