Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More updates around the extra_emails field #237

Merged
merged 4 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@ to configure DNS resolution during development::
Changelog
---------

v2.8.3 (02 May 2024)
~~~~~~~~~~~~~~~~~~~~

- Make sure to populate the ``extra_emails`` field when cloning a tenant


v2.8.2 (01 May 2024)
~~~~~~~~~~~~~~~~~~~~

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def get_install_requires(path):

setup(
name="kiwitcms-tenants",
version="2.8.2",
version="2.8.3",
description="Multi-tenant support for Kiwi TCMS",
long_description=get_long_description(),
author="Kiwi TCMS",
Expand Down
9 changes: 9 additions & 0 deletions tcms_tenants/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ def test_create_tenant_with_name_schema_only(self, send_mail):
# this is what the default form view sends
"owner": self.tester.pk,
"publicly_readable": False,
# note: not shown in the UI b/c it' meant for override templates
"extra_emails": "[email protected]; [email protected]",
"paid_until": "",
},
)
Expand All @@ -146,6 +148,7 @@ def test_create_tenant_with_name_schema_only(self, send_mail):
tenant = Tenant.objects.get(schema_name="tinc")
self.assertFalse(tenant.publicly_readable)
self.assertIsNone(tenant.paid_until)
self.assertEqual(tenant.extra_emails, "[email protected]; [email protected]")

# assert email was sent
self.assertTrue(send_mail.called)
Expand Down Expand Up @@ -180,6 +183,7 @@ def test_create_tenant_with_name_schema_publicly_readable_payment_date(self):
tenant = Tenant.objects.get(schema_name="subscriber")
self.assertFalse(tenant.publicly_readable)
self.assertEqual(tenant.paid_until, paid_until)
self.assertEqual(tenant.extra_emails, "-")

# assert tenant owner was added to default groups
with tenant_context(tenant):
Expand Down Expand Up @@ -309,6 +313,8 @@ def update_and_assert_tenant(self):
"schema_name": self.tenant.schema_name,
"publicly_readable": True,
"paid_until": "",
# note: not shown in the UI b/c it' meant for override templates
"extra_emails": "[email protected]; [email protected]",
},
follow=True,
)
Expand All @@ -318,6 +324,9 @@ def update_and_assert_tenant(self):

self.tenant.refresh_from_db()
self.assertTrue(self.tenant.publicly_readable)
self.assertEqual(
self.tenant.extra_emails, "[email protected]; [email protected]"
)

def test_super_user_can_edit_any_tenant(self):
# Given
Expand Down
2 changes: 2 additions & 0 deletions tcms_tenants/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ def create_tenant(form, request):
request.user.pk,
"--organization",
form.cleaned_data["organization"] or "-",
"--extra_emails",
form.cleaned_data["extra_emails"] or "-",
"--domain-domain",
tenant_domain(schema_name),
"--domain-is_primary",
Expand Down
Loading