Skip to content

Commit

Permalink
Add email field to the organization serializer
Browse files Browse the repository at this point in the history
Co-authored-by: Kelvin Muchiri <[email protected]>
  • Loading branch information
FrankApiyo and kelvin-muchiri committed Jul 23, 2024
1 parent d7e3254 commit 36a23ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,10 @@ def test_orgs_get_anon(self):
self.assertTrue(isinstance(user["user"], text))

def test_orgs_create(self):
self._org_create()
org_email = "[email protected]"
self._org_create(org_data = {"email": org_email})
self.assertTrue(self.organization.user.is_active)
self.assertEqual(self.organization.user.email, org_email)

def test_orgs_create_without_name(self):
data = {
Expand Down
1 change: 1 addition & 0 deletions onadata/libs/serializers/organization_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class OrganizationSerializer(serializers.HyperlinkedModelSerializer):
user = serializers.HyperlinkedRelatedField(
view_name="user-detail", lookup_field="username", read_only=True
)
email = serializers.EmailField(allow_blank=True)
creator = serializers.HyperlinkedRelatedField(
view_name="user-detail", lookup_field="username", read_only=True
)
Expand Down

0 comments on commit 36a23ae

Please sign in to comment.