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

Show number of voters in poll and small enhancement for sub page. #114

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

sometimesok
Copy link
Contributor

No description provided.

ISS/models/core_models.py Show resolved Hide resolved
ISS/models/core_models.py Outdated Show resolved Hide resolved
Comment on lines +237 to +239
for post in Post.objects.all():
post.content = post.content.replace("author=\"" + self.username + "\"", "author=\"" + str(other) + "\"")
post.save()
Copy link
Owner

Choose a reason for hiding this comment

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

I know people don't like having their usernames hang out in quotes, but we can't do this for two reasons:

  1. On a policy/moral level this edits posts belonging to people other than the person anonymizing themselves. Editing other peoples posts is a right reserved for the tyrant (me)
  2. Iterating over every post in the DB, doing a string substitution, and writing back to the DB is going to clobber the DB. On NiS prod the select query probably won't even finish before we run out of memory.

ISS/models/core_models.py Outdated Show resolved Hide resolved
ISS/models/core_models.py Outdated Show resolved Hide resolved
ISS/views/forum.py Outdated Show resolved Hide resolved
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.

2 participants