From cff35dd408e6b76f5a0cbe48f2435498570f3a6d Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Mon, 26 Jan 2015 21:49:22 +0100 Subject: [PATCH] define User.is_sftp_user and fix minor template issues --- gnuviechadmin/osusers/models.py | 4 ++++ .../hostingpackages/customerhostingpackage_detail.html | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gnuviechadmin/osusers/models.py b/gnuviechadmin/osusers/models.py index 5f64a12..2f62463 100644 --- a/gnuviechadmin/osusers/models.py +++ b/gnuviechadmin/osusers/models.py @@ -266,6 +266,10 @@ class User(TimeStampedModel, models.Model): _LOGGER.info("set LDAP password for %s", dn) return True + def is_sftp_user(self): + return self.additionalgroup_set.filter( + group__groupname=settings.OSUSER_SFTP_GROUP + ).exists() @transaction.atomic def save(self, *args, **kwargs): diff --git a/gnuviechadmin/templates/hostingpackages/customerhostingpackage_detail.html b/gnuviechadmin/templates/hostingpackages/customerhostingpackage_detail.html index 0f13250..f487f4f 100644 --- a/gnuviechadmin/templates/hostingpackages/customerhostingpackage_detail.html +++ b/gnuviechadmin/templates/hostingpackages/customerhostingpackage_detail.html @@ -37,7 +37,7 @@ {% endwith %}
{% trans "Mailboxes" %}
{% blocktrans with num=hostingpackage.used_mailbox_count total=hostingpackage.mailbox_count %}{{ num }} of {{ total }} in use{% endblocktrans %}
+ glyphicon-info-sign" title="{% blocktrans with mailboxcount=hostingpackage.mailboxcount %}The package provides {{ mailboxcount }} mailboxes the difference comes from mailbox options.{% endblocktrans %}">
{% if osuser.is_sftp_user %}{% trans "SFTP username" %}{% else %}{% trans "SSH/SFTP username" %}{% endif %}
{{ osuser.username }}
{% trans "Upload server" %}
@@ -67,7 +67,7 @@
{% trans "Hosting Package Actions" %}