-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move organization email from metadata -> organization email field
- Loading branch information
1 parent
7edc29c
commit a8c0a66
Showing
5 changed files
with
27 additions
and
15 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
onadata/apps/api/migrations/0008_organizationprofile_organization_email.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 4.2.14 on 2024-10-01 08:01 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('api', '0007_odktoken_expires'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='organizationprofile', | ||
name='organization_email', | ||
field=models.EmailField(blank=True, max_length=254, verbose_name='email address'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -222,10 +222,7 @@ def test_orgs_get_anon(self): | |
def test_orgs_create(self): | ||
self._org_create() | ||
self.assertTrue(self.organization.user.is_active) | ||
self.assertTrue("billing_email" in self.organization.metadata) | ||
self.assertEqual( | ||
self.organization.metadata["billing_email"], "[email protected]" | ||
) | ||
self.assertEqual(self.organization.email, "[email protected]") | ||
|
||
def test_orgs_create_without_name(self): | ||
data = { | ||
|
@@ -267,8 +264,7 @@ def test_org_create_and_fetch_by_admin_user(self): | |
request.user = self.user | ||
response = self.view(request) | ||
self.assertEqual(response.status_code, 201) | ||
self.assertTrue("billing_email" in response.data["metadata"]) | ||
self.assertEqual(response.data["metadata"]["billing_email"], org_email) | ||
self.assertEqual(response.data["email"], org_email) | ||
|
||
def test_org_create_with_anonymous_user(self): | ||
data = { | ||
|
@@ -456,10 +452,7 @@ def test_role_for_org_non_owner(self): | |
request = self.factory.get("/", **self.extra) | ||
response = view(request, user="denoinc") | ||
self.assertEqual(response.status_code, 200) | ||
self.assertTrue("billing_email" in response.data["metadata"]) | ||
self.assertEqual( | ||
response.data["metadata"]["billing_email"], "[email protected]" | ||
) | ||
self.assertEqual(response.data["email"], "[email protected]") | ||
self.assertIn("users", list(response.data)) | ||
|
||
for user in response.data["users"]: | ||
|
@@ -988,7 +981,7 @@ def test_member_added_to_org_with_correct_perms(self): | |
}, | ||
{ | ||
"is_org": True, | ||
"metadata": {"billing_email": "[email protected]"}, | ||
"metadata": {}, | ||
"first_name": "Dennis", | ||
"last_name": "", | ||
"user": "denoinc", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters