theforeman/foreman — pull request #648 by GregSutcliffe (2013-05-23 17:48:43+00:00)
Title: Fixes #2519 - Protect locale cahnges from validation failure so that password validation can be run 

Debugged this a little, and tracked down the cause. The problem is here:

https://github.com/theforeman/foreman/commit/e2c2abfea496c581f0b9d66e3074caf0f9604f75#L9R15

Because the validation is now skipped, the :prepare_password filter is also skipped. Sadly we can't just re-enable validations as it breaks looking for the non-existant locale column.

This patch reverts and re-enables the validations, but then checks if the locale column has been created yet when running the locale validations. This protects the admin user creation migration from bombing out.