Fix default parameter.

Default parameters are evaulated on initial loading. This isn't alwasy
appropriate.

Change-Id: Ie85d62fdfd97245982bf730eb71342c13a979235
Fix db migrations.

DB migrations in db8999872f2f92640cb01e984d821c587050de0e were
insufficient.

We may not have to rename institute, but we do have to:
* rename people_institutedelegate
* update content types.

Change-Id: I499920a15229eea61cd67f6ab87f9692114cbc65
Don't set initial password.

Setting the initial password on new accounts to '' was broken behaviour
introduced by 96fc5ae69bc0d1c0037e2223f0dccfcf6347abed.

Don't set userPassword field, this should result in a account
with no usable password.

Change-Id: I98bfaeebf39789e2a45dd177086fef7b8ecb78f4
Fix groups.

Store groups in Django so that we don't rely on retrieving group
assignments from LDAP.

Has significant schema changes. In particular we remove the gid
fields from Institute and softwarePackage, and the users fields
from Projects. These fields are replaced with a ForeignKey
reference to Group, which is a new generic model that represents
groups.

Have added the appropriate function to datastores to support this
new group type using the AccountsDataStore. Groups are created
for every machine category configured.

Currently the group GUI doesn't support adding/removing members.
It should be possible to add this later on.

Change-Id: I089f6ade4e39c0b059e83129b889820f57980519
Simplify LDAP schemas.

Since 96fc5ae69bc0d1c0037e2223f0dccfcf6347abed we no longer
require the person schemas. This greatly simplifies LDAP
processing and reduces the possiblitity of bugs by choosing
person/account incorrectly.

Change-Id: I8208f163deee41679a61a16e9895ee3dac834248
Fix verbose display.

Ensure verbose display doesn't hardcode LDAP support.

Change-Id: I89676bbcce04766e1b9e926320a9daf9262aebb2
Fix group detail title.

Change-Id: I9dcec35fc719a02e3b4ebb9d951aac420aa8724d
Add/remove group members.

Change-Id: I263be287f0ef92c1d2b7220a9a38176dd32a7c75
Improve group_detail template.

Change-Id: Iccb7bb9cc5bebb703b9d72ee8d27c97123628c1b
Improvements to templates.

Change-Id: If8fe6d41e7a4b3d7047a4a6840d7615cba6c56fe
Fix package imports.

Change-Id: Iffdfa6800e223187f1b74a9cc5ac03e0a857a0f3
Fix issues creating objects.

If pk was set on object creation, would be treated as update not a
create. Futhermore some datastore methods not correctly called.

Simplify this code, instead of trying to distinguish create vs.  updates
which both do the same thing anyway, combine both into a save operation
which will check which operation needs to be done.

Also update comments in delete() methods.

Change-Id: Ief16836287f856efb8687fe8b766a0feadcb221f
Make personal and account datastores consistant

* Use save method instead of create and update.
* Remove update_datastore flag on save method.
* Add delete() methods.

Change-Id: Ic9a23391df3ff5676786072e4da305f52a8437f6
Simplify logging.

If user is None, work it out automatically.

Change-Id: I81608239d28099ad57bd839c4d80baf59c3c5a03
Add/improve logging.

Change-Id: Ibdfe3d206350e12e5ad87b362e099dfc0a693685
Simplify log call

As of 4d2c13f88948e110dfc5a4a691dee46d55687179 we no longer need
to call get_current_user() in order to call log().

Change-Id: I4fdec314edb9d02957bdcd39f2eb1edb8c7e9bd8
Fix get_current_user from CLI

Ensure we don't crash if no logged in user, e.g. when called from CLI or
user not logged in.

Change-Id: I03884f979efd040a1cbcceb2906112ffb585ea7a