Set USER_SUPPORT_EMAIL

This commit is contained in:
Santiago L 2023-11-23 19:59:14 +01:00
parent bae29f766f
commit 7c85f219d8
7 changed files with 127 additions and 97 deletions

View File

@ -235,6 +235,8 @@ LOGIN_URL = 'musician:login'
LOGOUT_REDIRECT_URL = 'musician:login' LOGOUT_REDIRECT_URL = 'musician:login'
USER_SUPPORT_EMAIL = "support@example.com"
################################# #################################
## 3RD PARTY APPS CONFIGURATION ## ## 3RD PARTY APPS CONFIGURATION ##
################################# #################################

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-11-24 11:04+0100\n" "POT-Creation-Date: 2023-11-23 19:57+0100\n"
"PO-Revision-Date: 2021-11-25 12:53+0100\n" "PO-Revision-Date: 2021-11-25 12:53+0100\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@ -18,53 +18,53 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.0\n" "X-Generator: Poedit 3.0\n"
#: api.py:113 api.py:211 #: api.py:127 api.py:226
msgid "No domain found matching the query" msgid "No domain found matching the query"
msgstr "No trobem cap domini que coincideixi amb la teva consulta" msgstr "No trobem cap domini que coincideixi amb la teva consulta"
#: api.py:125 #: api.py:139
msgid "No object found matching the query" msgid "No object found matching the query"
msgstr "No trobem cap objecte que coincideixi amb la teva consulta" msgstr "No trobem cap objecte que coincideixi amb la teva consulta"
#: api.py:178 #: api.py:192
msgid "No mailbox found matching the query" msgid "No mailbox found matching the query"
msgstr "No trobem cap bústia que coincideixi amb la teva consulta" msgstr "No trobem cap bústia que coincideixi amb la teva consulta"
#: forms.py:65 forms.py:99 #: forms.py:57 forms.py:88
msgid "The two password fields didnt match." msgid "The two password fields didnt match."
msgstr "Les contrasenyes introduïdes no coincideixen." msgstr "Les contrasenyes introduïdes no coincideixen."
#: forms.py:68 forms.py:103 #: forms.py:60 forms.py:92
msgid "Password" msgid "Password"
msgstr "Contrasenya" msgstr "Contrasenya"
#: forms.py:73 forms.py:108 #: forms.py:65 forms.py:97
msgid "Password confirmation" msgid "Password confirmation"
msgstr "Confirma la contrasenya" msgstr "Confirma la contrasenya"
#: forms.py:76 forms.py:111 #: forms.py:68 forms.py:100
msgid "Enter the same password as before, for verification." msgid "Enter the same password as before, for verification."
msgstr "Introdueix la mateixa contrasenya per verificar-la." msgstr "Introdueix la mateixa contrasenya per verificar-la."
#: mixins.py:14 #: mixins.py:17
msgid "Domains & websites" msgid "Domains & websites"
msgstr "Dominis i llocs web" msgstr "Dominis i llocs web"
#: mixins.py:15 #: mixins.py:18
msgid "Mails" msgid "Mails"
msgstr "Correus" msgstr "Correus"
#. Translators: This message appears on the page title #. Translators: This message appears on the page title
#: mixins.py:16 views.py:296 #: mixins.py:19 views.py:324
msgid "Mailing lists" msgid "Mailing lists"
msgstr "Llistes de correu" msgstr "Llistes de correu"
#. Translators: This message appears on the page title #. Translators: This message appears on the page title
#: mixins.py:17 models.py:147 views.py:480 #: mixins.py:20 models.py:147 views.py:446
msgid "Databases" msgid "Databases"
msgstr "Bases de dades" msgstr "Bases de dades"
#: mixins.py:18 #: mixins.py:21
msgid "SaaS" msgid "SaaS"
msgstr "SaaS" msgstr "SaaS"
@ -73,7 +73,7 @@ msgid "Description details for databases page."
msgstr "Consulta la configuració de les teves bases de dades." msgstr "Consulta la configuració de les teves bases de dades."
#. Translators: This message appears on the page title #. Translators: This message appears on the page title
#: models.py:235 views.py:185 #: models.py:235 views.py:247
msgid "Mail addresses" msgid "Mail addresses"
msgstr "Adreces de correu" msgstr "Adreces de correu"
@ -170,7 +170,7 @@ msgstr "Domini"
#. Translators: This message appears on the page title #. Translators: This message appears on the page title
#: templates/musician/addresses.html:17 templates/musician/mail_base.html:22 #: templates/musician/addresses.html:17 templates/musician/mail_base.html:22
#: views.py:325 #: views.py:355
msgid "Mailboxes" msgid "Mailboxes"
msgstr "Bústies de correu" msgstr "Bústies de correu"
@ -182,24 +182,28 @@ msgstr "Redirecció"
msgid "New mail address" msgid "New mail address"
msgstr "Nova adreça de correu" msgstr "Nova adreça de correu"
#: templates/musician/base.html:60 #: templates/musician/base.html:63
msgid "Settings" msgid "Settings"
msgstr "Configuració" msgstr "Configuració"
#: templates/musician/base.html:63 templates/musician/profile.html:6 #: templates/musician/base.html:66 templates/musician/profile.html:6
msgid "Profile" msgid "Profile"
msgstr "Perfil" msgstr "Perfil"
#. Translators: This message appears on the page title #. Translators: This message appears on the page title
#: templates/musician/base.html:64 templates/musician/billing.html:6 #: templates/musician/base.html:67 templates/musician/billing.html:6
#: views.py:163 #: views.py:205
msgid "Billing" msgid "Billing"
msgstr "Factures" msgstr "Factures"
#: templates/musician/base.html:72 #: templates/musician/base.html:82
msgid "Log out" msgid "Log out"
msgstr "Surt" msgstr "Surt"
#: templates/musician/base.html:93
msgid "Language"
msgstr ""
#: templates/musician/billing.html:7 #: templates/musician/billing.html:7
msgid "Billing page description." msgid "Billing page description."
msgstr "Consulta i descarrega les teves factures." msgstr "Consulta i descarrega les teves factures."
@ -285,7 +289,7 @@ msgid "Mail list"
msgstr "Llista de correu" msgstr "Llista de correu"
#. Translators: This message appears on the page title #. Translators: This message appears on the page title
#: templates/musician/dashboard.html:83 views.py:489 #: templates/musician/dashboard.html:83 views.py:456
msgid "Software as a Service" msgid "Software as a Service"
msgstr "Software as a Service" msgstr "Software as a Service"
@ -293,7 +297,7 @@ msgstr "Software as a Service"
msgid "Nothing installed" msgid "Nothing installed"
msgstr "No tens res instal·lat" msgstr "No tens res instal·lat"
#: templates/musician/dashboard.html:90 views.py:57 #: templates/musician/dashboard.html:90 views.py:70
msgid "Disk usage" msgid "Disk usage"
msgstr "Ús del disc" msgstr "Ús del disc"
@ -305,26 +309,30 @@ msgstr "Detalls de configuració"
msgid "FTP access:" msgid "FTP access:"
msgstr "Accés FTP:" msgstr "Accés FTP:"
#. Translators: domain configuration detail modal #: templates/musician/dashboard.html:117
#: templates/musician/dashboard.html:116 #, fuzzy, python-format
msgid "Contact with the support team to get details concerning FTP access." #| msgid ""
#| "Send an email to <a href=\"mailto:%(support_email)s\">%(support_email)s</"
#| "a> including your username and we will provide instructions."
msgid ""
"E-mail us at %(support_email_anchor)s to get details concerning FTP access."
msgstr "" msgstr ""
"Escriu-nos a <a href=“mailto:%(support_email)s”>%(support_email)s</a> per " "Envia un correu a <a href=\"mailto:%(support_email)s\">%(support_email)s</a> "
"saber com accedir al FTP." "indicant el teu nom dusuari/a i texplicarem què fer."
#: templates/musician/dashboard.html:125 #: templates/musician/dashboard.html:127
msgid "No website configured." msgid "No website configured."
msgstr "No hi ha cap web configurada." msgstr "No hi ha cap web configurada."
#: templates/musician/dashboard.html:127 #: templates/musician/dashboard.html:129
msgid "Root directory:" msgid "Root directory:"
msgstr "Directori arrel:" msgstr "Directori arrel:"
#: templates/musician/dashboard.html:128 #: templates/musician/dashboard.html:130
msgid "Type:" msgid "Type:"
msgstr "Tipus:" msgstr "Tipus:"
#: templates/musician/dashboard.html:133 #: templates/musician/dashboard.html:135
msgid "View DNS records" msgid "View DNS records"
msgstr "Veure registres DNS" msgstr "Veure registres DNS"
@ -472,56 +480,60 @@ msgid "Open service admin panel"
msgstr "Obre el panell dadministració del servei" msgstr "Obre el panell dadministració del servei"
#. Translators: This message appears on the page title #. Translators: This message appears on the page title
#: views.py:41 #: views.py:54
msgid "Dashboard" msgid "Dashboard"
msgstr "Panell de gestió" msgstr "Panell de gestió"
#: views.py:66 #: views.py:79
msgid "Traffic" msgid "Traffic"
msgstr "Tràfic" msgstr "Tràfic"
#: views.py:97 #: views.py:117
msgid "Mailbox usage" msgid "Mailbox usage"
msgstr "Ús despai a la bústia de correu" msgstr "Ús despai a la bústia de correu"
#. Translators: This message appears on the page title #. Translators: This message appears on the page title
#: views.py:112 #: views.py:132
msgid "User profile" msgid "User profile"
msgstr "El teu perfil" msgstr "El teu perfil"
#. Translators: This message appears on the page title #. Translators: This message appears on the page title
#: views.py:170 #: views.py:219
msgid "Download bill" msgid "Download bill"
msgstr "Descarrega la factura" msgstr "Descarrega la factura"
#: views.py:283 #: views.py:310
msgid "Address deleted!" msgid "Address deleted!"
msgstr "Sha suprimit ladreça de correu" msgstr "Sha suprimit ladreça de correu"
#: views.py:285 views.py:422 views.py:469 #: views.py:312 views.py:412
msgid "Cannot process your request, please try again later." msgid "Cannot process your request, please try again later."
msgstr "" msgstr ""
"Ara no podem processar la teva petició, torna a intentar-ho una mica més " "Ara no podem processar la teva petició, torna a intentar-ho una mica més "
"tard sisplau" "tard sisplau"
#: views.py:420 #: views.py:410
msgid "Mailbox deleted!" msgid "Mailbox deleted!"
msgstr "Sha suprimit la bústia de correu" msgstr "Sha suprimit la bústia de correu"
#: views.py:467
msgid "Password updated!"
msgstr "Sha actualitzat la contrasenya"
#. Translators: This message appears on the page title #. Translators: This message appears on the page title
#: views.py:497 #: views.py:464
msgid "Domain details" msgid "Domain details"
msgstr "Detalls del domini" msgstr "Detalls del domini"
#. Translators: This message appears on the page title #. Translators: This message appears on the page title
#: views.py:523 #: views.py:478
msgid "Login" msgid "Login"
msgstr "Accés" msgstr "Accés"
#~ msgid "Contact with the support team to get details concerning FTP access."
#~ msgstr ""
#~ "Escriu-nos a <a href=“mailto:%(support_email)s”>%(support_email)s</a> per "
#~ "saber com accedir al FTP."
#~ msgid "Password updated!"
#~ msgstr "Sha actualitzat la contrasenya"
#~ msgid "mail address left" #~ msgid "mail address left"
#~ msgstr "adreces de correu per activar" #~ msgstr "adreces de correu per activar"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-11-24 11:04+0100\n" "POT-Creation-Date: 2023-11-23 19:57+0100\n"
"PO-Revision-Date: 2021-11-25 12:53+0100\n" "PO-Revision-Date: 2021-11-25 12:53+0100\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@ -18,53 +18,53 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.0\n" "X-Generator: Poedit 3.0\n"
#: api.py:113 api.py:211 #: api.py:127 api.py:226
msgid "No domain found matching the query" msgid "No domain found matching the query"
msgstr "No hay dominios que coincidan con tu búsqueda" msgstr "No hay dominios que coincidan con tu búsqueda"
#: api.py:125 #: api.py:139
msgid "No object found matching the query" msgid "No object found matching the query"
msgstr "No hay objetos que coincidan con tu búsqueda" msgstr "No hay objetos que coincidan con tu búsqueda"
#: api.py:178 #: api.py:192
msgid "No mailbox found matching the query" msgid "No mailbox found matching the query"
msgstr "No hay buzones de correo que coincidan con tu búsqueda" msgstr "No hay buzones de correo que coincidan con tu búsqueda"
#: forms.py:65 forms.py:99 #: forms.py:57 forms.py:88
msgid "The two password fields didnt match." msgid "The two password fields didnt match."
msgstr "Las contraseñas introducidas no coinciden." msgstr "Las contraseñas introducidas no coinciden."
#: forms.py:68 forms.py:103 #: forms.py:60 forms.py:92
msgid "Password" msgid "Password"
msgstr "Contraseña" msgstr "Contraseña"
#: forms.py:73 forms.py:108 #: forms.py:65 forms.py:97
msgid "Password confirmation" msgid "Password confirmation"
msgstr "Confirma la contraseña" msgstr "Confirma la contraseña"
#: forms.py:76 forms.py:111 #: forms.py:68 forms.py:100
msgid "Enter the same password as before, for verification." msgid "Enter the same password as before, for verification."
msgstr "Introduce la misma contraseña para verificarla" msgstr "Introduce la misma contraseña para verificarla"
#: mixins.py:14 #: mixins.py:17
msgid "Domains & websites" msgid "Domains & websites"
msgstr "Dominios y sitios web" msgstr "Dominios y sitios web"
#: mixins.py:15 #: mixins.py:18
msgid "Mails" msgid "Mails"
msgstr "Correos" msgstr "Correos"
#. Translators: This message appears on the page title #. Translators: This message appears on the page title
#: mixins.py:16 views.py:296 #: mixins.py:19 views.py:324
msgid "Mailing lists" msgid "Mailing lists"
msgstr "Listas de correo" msgstr "Listas de correo"
#. Translators: This message appears on the page title #. Translators: This message appears on the page title
#: mixins.py:17 models.py:147 views.py:480 #: mixins.py:20 models.py:147 views.py:446
msgid "Databases" msgid "Databases"
msgstr "Bases de datos" msgstr "Bases de datos"
#: mixins.py:18 #: mixins.py:21
msgid "SaaS" msgid "SaaS"
msgstr "SaaS" msgstr "SaaS"
@ -73,7 +73,7 @@ msgid "Description details for databases page."
msgstr "Consulta la configuración de tus bases de datos." msgstr "Consulta la configuración de tus bases de datos."
#. Translators: This message appears on the page title #. Translators: This message appears on the page title
#: models.py:235 views.py:185 #: models.py:235 views.py:247
msgid "Mail addresses" msgid "Mail addresses"
msgstr "Direcciones de correo" msgstr "Direcciones de correo"
@ -172,7 +172,7 @@ msgstr "Dominio"
#. Translators: This message appears on the page title #. Translators: This message appears on the page title
#: templates/musician/addresses.html:17 templates/musician/mail_base.html:22 #: templates/musician/addresses.html:17 templates/musician/mail_base.html:22
#: views.py:325 #: views.py:355
msgid "Mailboxes" msgid "Mailboxes"
msgstr "Buzones de correo" msgstr "Buzones de correo"
@ -184,24 +184,28 @@ msgstr "Redirección"
msgid "New mail address" msgid "New mail address"
msgstr "Nueva dirección de correo" msgstr "Nueva dirección de correo"
#: templates/musician/base.html:60 #: templates/musician/base.html:63
msgid "Settings" msgid "Settings"
msgstr "Configuración" msgstr "Configuración"
#: templates/musician/base.html:63 templates/musician/profile.html:6 #: templates/musician/base.html:66 templates/musician/profile.html:6
msgid "Profile" msgid "Profile"
msgstr "Perfil" msgstr "Perfil"
#. Translators: This message appears on the page title #. Translators: This message appears on the page title
#: templates/musician/base.html:64 templates/musician/billing.html:6 #: templates/musician/base.html:67 templates/musician/billing.html:6
#: views.py:163 #: views.py:205
msgid "Billing" msgid "Billing"
msgstr "Facturas" msgstr "Facturas"
#: templates/musician/base.html:72 #: templates/musician/base.html:82
msgid "Log out" msgid "Log out"
msgstr "Desconéctate" msgstr "Desconéctate"
#: templates/musician/base.html:93
msgid "Language"
msgstr ""
#: templates/musician/billing.html:7 #: templates/musician/billing.html:7
msgid "Billing page description." msgid "Billing page description."
msgstr "Consulta y descarga tus facturas." msgstr "Consulta y descarga tus facturas."
@ -287,7 +291,7 @@ msgid "Mail list"
msgstr "Lista de correo" msgstr "Lista de correo"
#. Translators: This message appears on the page title #. Translators: This message appears on the page title
#: templates/musician/dashboard.html:83 views.py:489 #: templates/musician/dashboard.html:83 views.py:456
msgid "Software as a Service" msgid "Software as a Service"
msgstr "Software as a Service" msgstr "Software as a Service"
@ -295,7 +299,7 @@ msgstr "Software as a Service"
msgid "Nothing installed" msgid "Nothing installed"
msgstr "No tienes nada instalado" msgstr "No tienes nada instalado"
#: templates/musician/dashboard.html:90 views.py:57 #: templates/musician/dashboard.html:90 views.py:70
msgid "Disk usage" msgid "Disk usage"
msgstr "Uso del disco" msgstr "Uso del disco"
@ -307,26 +311,30 @@ msgstr "Detalles de configuración"
msgid "FTP access:" msgid "FTP access:"
msgstr "Acceso FTP:" msgstr "Acceso FTP:"
#. Translators: domain configuration detail modal #: templates/musician/dashboard.html:117
#: templates/musician/dashboard.html:116 #, fuzzy, python-format
msgid "Contact with the support team to get details concerning FTP access." #| msgid ""
#| "Send an email to <a href=\"mailto:%(support_email)s\">%(support_email)s</"
#| "a> including your username and we will provide instructions."
msgid ""
"E-mail us at %(support_email_anchor)s to get details concerning FTP access."
msgstr "" msgstr ""
"Escríbenos a <a href=“mailto:%(support_email)s”>%(support_email)s</a> para " "Envía un correo a <a href=“mailto:%(support_email)s”>%(support_email)s</a> "
"saber cómo acceder al FTP." "indicando tu nombre de usuaria/o y te explicaremos qué hacer."
#: templates/musician/dashboard.html:125 #: templates/musician/dashboard.html:127
msgid "No website configured." msgid "No website configured."
msgstr "No hay ninguna web configurada." msgstr "No hay ninguna web configurada."
#: templates/musician/dashboard.html:127 #: templates/musician/dashboard.html:129
msgid "Root directory:" msgid "Root directory:"
msgstr "Directorio raíz:" msgstr "Directorio raíz:"
#: templates/musician/dashboard.html:128 #: templates/musician/dashboard.html:130
msgid "Type:" msgid "Type:"
msgstr "Tipo:" msgstr "Tipo:"
#: templates/musician/dashboard.html:133 #: templates/musician/dashboard.html:135
msgid "View DNS records" msgid "View DNS records"
msgstr "Ver registros DNS" msgstr "Ver registros DNS"
@ -474,53 +482,49 @@ msgid "Open service admin panel"
msgstr "Abre el panel de administración del servicio" msgstr "Abre el panel de administración del servicio"
#. Translators: This message appears on the page title #. Translators: This message appears on the page title
#: views.py:41 #: views.py:54
msgid "Dashboard" msgid "Dashboard"
msgstr "Panel de gestión" msgstr "Panel de gestión"
#: views.py:66 #: views.py:79
msgid "Traffic" msgid "Traffic"
msgstr "Tráfico" msgstr "Tráfico"
#: views.py:97 #: views.py:117
msgid "Mailbox usage" msgid "Mailbox usage"
msgstr "Uso de espacio en tu buzón de correo" msgstr "Uso de espacio en tu buzón de correo"
#. Translators: This message appears on the page title #. Translators: This message appears on the page title
#: views.py:112 #: views.py:132
msgid "User profile" msgid "User profile"
msgstr "Tu perfil" msgstr "Tu perfil"
#. Translators: This message appears on the page title #. Translators: This message appears on the page title
#: views.py:170 #: views.py:219
msgid "Download bill" msgid "Download bill"
msgstr "Descarga la factura" msgstr "Descarga la factura"
#: views.py:283 #: views.py:310
msgid "Address deleted!" msgid "Address deleted!"
msgstr "Has eliminado la dirección de correo" msgstr "Has eliminado la dirección de correo"
#: views.py:285 views.py:422 views.py:469 #: views.py:312 views.py:412
msgid "Cannot process your request, please try again later." msgid "Cannot process your request, please try again later."
msgstr "" msgstr ""
"Ahora no podemos procesar tu petición, inténtalo de nuevo un poco más tarde " "Ahora no podemos procesar tu petición, inténtalo de nuevo un poco más tarde "
"por favor." "por favor."
#: views.py:420 #: views.py:410
msgid "Mailbox deleted!" msgid "Mailbox deleted!"
msgstr "Has eliminado el buzón de correo" msgstr "Has eliminado el buzón de correo"
#: views.py:467
msgid "Password updated!"
msgstr "Contraseña actualizada"
#. Translators: This message appears on the page title #. Translators: This message appears on the page title
#: views.py:497 #: views.py:464
msgid "Domain details" msgid "Domain details"
msgstr "Detalles del dominio" msgstr "Detalles del dominio"
#. Translators: This message appears on the page title #. Translators: This message appears on the page title
#: views.py:523 #: views.py:478
msgid "Login" msgid "Login"
msgstr "Accede" msgstr "Accede"

View File

@ -113,7 +113,9 @@
<div class="domain-ftp pb-3 border-bottom"> <div class="domain-ftp pb-3 border-bottom">
<h6 class="pl-4 mb-4">{% trans "FTP access:" %}</h6> <h6 class="pl-4 mb-4">{% trans "FTP access:" %}</h6>
{# Translators: domain configuration detail modal #} {# Translators: domain configuration detail modal #}
<p>{% trans "Contact with the support team to get details concerning FTP access." %}</p> <p>
{% blocktrans %}E-mail us at {{ support_email_anchor }} to get details concerning FTP access.{% endblocktrans %}
</p>
{% comment %} {% comment %}
<!-- hidden until API provides FTP information --> <!-- hidden until API provides FTP information -->
<label>{% trans "Username" %}:</label> <span id="config-username" class="font-weight-bold">username</span><br/> <label>{% trans "Username" %}:</label> <span id="config-username" class="font-weight-bold">username</span><br/>

View File

@ -87,10 +87,17 @@ class DashboardView(CustomContextMixin, UserTokenRequiredMixin, TemplateView):
'mailbox': self.get_mailbox_usage(profile_type), 'mailbox': self.get_mailbox_usage(profile_type),
} }
support_email = getattr(settings, "USER_SUPPORT_EMAIL", "suport@pangea.org")
support_email_anchor = format_html(
"<a href='mailto:{}'>{}</a>",
support_email,
support_email,
)
context.update({ context.update({
'domains': domains, 'domains': domains,
'resource_usage': resource_usage, 'resource_usage': resource_usage,
'notifications': notifications, 'notifications': notifications,
"support_email_anchor": support_email_anchor,
}) })
return context return context
@ -252,10 +259,11 @@ class MailView(ServiceListView):
context = super().get_context_data(**kwargs) context = super().get_context_data(**kwargs)
domain_id = self.request.GET.get('domain') domain_id = self.request.GET.get('domain')
if domain_id: if domain_id:
qs = Domain.objects.filter(account=self.request.user)
context.update({ context.update({
'active_domain': self.orchestra.retrieve_domain(domain_id) 'active_domain': get_object_or_404(qs, pk=domain_id)
}) })
context['mailboxes'] = self.orchestra.retrieve_mailbox_list() context['mailboxes'] = Mailbox.objects.filter(account=self.request.user)
return context return context
@ -316,22 +324,24 @@ class MailingListsView(ServiceListView):
'title': _('Mailing lists'), 'title': _('Mailing lists'),
} }
def get_queryset(self):
return self.model.objects.filter(account=self.request.user).order_by("name")
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs) context = super().get_context_data(**kwargs)
domain_id = self.request.GET.get('domain') domain_id = self.request.GET.get('domain')
if domain_id: if domain_id:
qs = Domain.objects.filter(account=self.request.user)
context.update({ context.update({
'active_domain': self.orchestra.retrieve_domain(domain_id) 'active_domain': get_object_or_404(qs, pk=domain_id)
}) })
return context return context
def get_queryfilter(self): def get_queryfilter(self):
"""Retrieve query params (if any) to filter queryset""" """Retrieve query params (if any) to filter queryset"""
# TODO(@slamora): this is not working because backend API
# doesn't support filtering by domain
domain_id = self.request.GET.get('domain') domain_id = self.request.GET.get('domain')
if domain_id: if domain_id:
return {"domain": domain_id} return {"address_domain_id": domain_id}
return {} return {}