learningequality/ka-lite — pull request #669 by bcipolli (2013-09-08 07:05:07+00:00)
Title: Save registration information [release-0.10]

[separately targeting to release-0.10, as develop codepath is quite different]
Background:
In the spirit of greater data mining and understanding our user-base, I suggest we keep more careful track between the relationship between:
* Adding a RegistrationDevicePublicKey (i.e. clicking the "registration" button on the central server)
* Using that key (happens the first time the distributed server syncs)
* The first successful sync session

Seeing a difference between the first and second would tell us how users tend to use their devices, and if we can bridge any gaps.

Implementation:
* Never delete PublicDeviceRegistrationKey objects
* Add two timestamps: creation date and used date, to track those events.
* Only allow claiming of registration keys that haven't been used (used date is None)