Guest User

Untitled

a guest
Jun 23rd, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. for p_h in Page.versions.filter(version_info__user=other_matt):
  2. p_h.history_user = matt #Have to set using the direct "history_user" attribute rather than p_h.version_info.user (which doesn't allow mutation)
  3. p_h.save()
  4.  
  5. other_matt_profile = UserProfile.objects.get(user=other_matt)
  6. other_matt_profile.delete()
  7. other_matt.delete()
Add Comment
Please, Sign In to add comment