learningequality/ka-lite — pull request #261 by bcipolli (2013-07-21 15:00:18+00:00)
Title: full clean before signing (to make sure what we sign is the data that we'll keep)

When we sign, we need to sign a hashable_representation of the data that reflects what will be stored in the database. To ensure that, we need to call full_clean on the model before signing it.

This bug is a general concern. The current behavior was causing UserLogSummary objects to fail under certain scenarios, where total_seconds (an integer) was set to a float (and then converted to an int during full_clean / save).

To reproduce the bug:
* Set up syncing central and distributed servers
* on the distributed server, run `python manage.py generaterealdata` (you don't have to wait for the full data to generate, just until at least one exercise log is created)
* on the distributed server, run `python syncmodels`
* You will see failures (for UserLogSummary objects)

An alternate way to reproduce (not requiring a central server)
* on the distributed server, run `python manage.py generaterealdata` (you don't have to wait for the full data to generate, just until at least one exercise log is created)
* run `python manage.py shell_plus`
* enter command `[uls.verify() for uls in UserLogSummary.objects.all()]
* This should return an array of False.