Comment 2 for bug 1503103

Revision history for this message
davosmith (8-launchpad-davosmith-co-uk) wrote :

I've been investigating this problem for a customer.

The issue appears to be that the default quota is correctly applied. However, when user->commit() is called, it first calls reload_background_fields(). As the userid is 0 at this point, the specified fields ('active', 'deleted', ... 'quota', 'unread') are loaded from the 'root' user record. This means that the user record will end up with the 'quota' value from 'root' user, rather than the default that was already correctly stored in memory.

I don't understand the 'reload_background_fields' operation quite enough to be confident about this, but my proposed fix would be simply to do nothing in the case where the userid is 0 - I don't think it makes sense to load data from user 0 in the case where the user has yet to be created.