Skip to content

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

Open
sometimesok wants to merge 10 commits into
Lanny:masterfrom
sometimesok:master
Open

Show number of voters in poll and small enhancement for sub page.#114
sometimesok wants to merge 10 commits into
Lanny:masterfrom
sometimesok:master

Conversation

@sometimesok
Copy link
Copy Markdown
Contributor

No description provided.

Comment thread ISS/models/core_models.py
Comment thread ISS/models/core_models.py Outdated
Comment thread ISS/models/core_models.py
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
Copy Markdown
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.

Comment thread ISS/models/core_models.py Outdated
Comment thread ISS/models/core_models.py Outdated
Comment thread ISS/views/forum.py Outdated
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