Open bitterjug opened 8 years ago
I think the fix should be to create the preferences when we try to access them, not when users are created, so as to be sure preferences are created transparently for existing users without them. Otherwise we have to trigger a save on each user to ensure they have a preferences instance. Maybe deploy along with another migration to make sure all existing users have preferences?
I've updated the fix to do the check when the 'preferences' property is accessed.
I just did a new deploy:dev on master and, as there were no logframes (#21) I went over to
/admin/logframe/logframe/
and created me one called test. Now I see it listed in the dashboard, but when I follow the link I getRelatedObjectDoesNotExist at /dashboard/test/
.You'd expect a user with no preferences would be easy to please.
Grepping for preferences in the source, I can't see anywhere where the preferences object gets created. Tests pass because the user object is mock.Mock()
And I suspect local user testing worked because a pre-existing user in the database got preferences added by the migration
But I can't see any code to create a preferences object for a new user.