learningequality/ka-lite — pull request #911 by jamalex (2013-11-02 07:32:28+00:00)
Title: Fix "by_zone" method to include models that have not yet been signed due to deferred signing

The "by_zone" manager method finds all the models that belong to a zone. It used to base this on a) being signed by a device on the zone, or b) being signed by the central server which specified it was on the zone.

Now, with deferred signing, locally created models can exist with `signed_by` set to None, and this excludes them from being counted in the zone. Thus, new facilities that had been created locally prior to a sync session would not show up on the control panel page, for example.

The solution here was to include models that haven't been signed, if we're requesting models that belong to our own zone.

@bcipolli, could this be related to what you were saying a while back about unsigned models not getting retrieved properly for serialization and syncing?