From 02b8e24f451954463d77e56e94ee0c0146a1e003 Mon Sep 17 00:00:00 2001 From: Marc Aymerich Date: Mon, 24 Nov 2014 20:09:44 +0000 Subject: [PATCH] Fixes on contacts --- TODO.md | 21 ++++++++++++++++++++- orchestra/apps/contacts/filters.py | 6 ++++-- orchestra/apps/resources/models.py | 8 +++++--- 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/TODO.md b/TODO.md index 238c05a0..0dc0b51a 100644 --- a/TODO.md +++ b/TODO.md @@ -161,4 +161,23 @@ * Rename apache logs ending on .log in order to logrotate easily -* SaaS wordpress multiple blogs per user? separate users from sites? +* SaaS wordpress multiple blogs per user? separate users from sites? SaaSUser SaaSSite models +* Custom domains for SaaS apps (wordpress Vhost) SaaSSite.domain ? + +* Change account and orders + + +==== SaaS ==== +Wordpress +--------- +* site_name +* email +* site_title +* site_domain (optional) + +BSCW +---- +* email +* username +* quota +* password (optional) diff --git a/orchestra/apps/contacts/filters.py b/orchestra/apps/contacts/filters.py index a41dca74..76783932 100644 --- a/orchestra/apps/contacts/filters.py +++ b/orchestra/apps/contacts/filters.py @@ -12,5 +12,7 @@ class EmailUsageListFilter(SimpleListFilter): return Contact.email_usage.field.choices def queryset(self, request, queryset): - value = self.value().split(',') - return queryset.filter(email_usages=value) + value = self.value() + if value is None: + return queryset + return queryset.filter(email_usages=value.split(',')) diff --git a/orchestra/apps/resources/models.py b/orchestra/apps/resources/models.py index ff0462ab..cb4d1af2 100644 --- a/orchestra/apps/resources/models.py +++ b/orchestra/apps/resources/models.py @@ -92,13 +92,15 @@ class Resource(models.Model): try: self.get_model_path(monitor) except (RuntimeError, LookupError): - monitor_errors.append(monitor) + model = get_model(ServiceMonitor.get_backend(monitor).model) + monitor_errors.append(model._meta.model_name) if monitor_errors: + model_name = self.content_type.model_class()._meta.model_name raise validators.ValidationError({ 'monitors': [ _("Path does not exists between '%s' and '%s'") % ( - get_model(ServiceMonitor.get_backend(monitor).model)._meta.model_name, - self.content_type.model_class()._meta.model_name, + error, + model_name, ) for error in monitor_errors ]})