Fix internal server error observed in django 1.7.
Fix internal server error observed in django 1.7.

With the removal of SQL Aggregates ie., models.sql.aggregates.Aggregate there
is a (500) Internal server error observed in django <=1.7, on the other hand
things are fine with django >=1.8.

This commit fixes the above by applying a temporary check for the django
version.

Change-Id: Ic8ffd96a3e00d130f9eebee845523df4529f2f1a

Linaro/lava-server,Linaro/lava-server,Linaro/lava-server,Linaro/lava-server