plug users and hosting packages together

- document new feature in changelog
- add autogenerated documentation for osusers.urls and osusers.views
- add osuser URLs to gnuviechadmin.urls
- implement get_absolute_url in hostingpackages.models.CustomerHostingPackage
- use set_ldap_user_password instead of create_ldap_user for existing OS users
  in osusers.models.User.set_password
- add URL pattern set_osuser_password in osusers.urls
- implement osusers.views.SetOsUserPassword to set the password of an existing
  operating system user
- link to hosting package detail view on user dashboard
- add template hostingpackages/customerhostingpackage_detail.html
- add template osusers/user_setpassword.html
This commit is contained in:
Jan Dittberner 2015-01-24 16:26:32 +01:00
parent 0d08d9876b
commit 150366a524
11 changed files with 181 additions and 6 deletions

View file

@ -5,6 +5,7 @@ This module contains the hosting package models.
from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.core.urlresolvers import reverse
from django.db import transaction
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@ -218,6 +219,12 @@ class CustomerHostingPackage(HostingPackageBase):
name=self.name, customer=self.customer
)
def get_absolute_url(self):
return reverse('hosting_package_details', kwargs={
'user': self.customer.username,
'pk': self.id,
})
def copy_template_attributes(self):
"""
Copy the attributes of the hosting package's template to the package.