divio/django-cms — pull request #3148 by morganwahl (2014-05-07 16:07:42+00:00)
Title: Made UserSettings.user unique.

This was a pretty simple change and migration. I believe it makes sense with the intended use of UserSettings.

This did cause a test to fail (`cms.tests.frontend.PlaceholderBasicTests`). I'm familiar enough with the Django CMS test suite to really debug that. Any hints?

Believe it or not, this field not being unique did cause a intermittent failure in our test suite for a project using Django CMS. Essentially, when multiple requests came in simultaneously for the same user who didn't have a UserSetting instance, it created multiple users. Presumably, the database didn't lock the UserSettings table when it was inserted into because there were no unique constraints.