Skip to content

Conversation

@sometimesok
Copy link
Contributor

No description provided.

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.

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