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

Add Organization Owner's email to Organization model #4309

Merged
merged 2 commits into from
Mar 6, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions kobo/apps/organizations/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
class Organization(AbstractOrganization):
uid = KpiUidField(uid_prefix='org')

@property
def email(self):
"""
As organization is our customer model for Stripe, Stripe requires that
it has an email address attribute
"""
return self.owner.organization_user.user.email


class OrganizationUser(AbstractOrganizationUser):
pass
Expand Down
1 change: 1 addition & 0 deletions kobo/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,7 @@ def __init__(self, *args, **kwargs):


''' Django allauth configuration '''
# User.email should continue to be used instead of the EmailAddress model
ACCOUNT_ADAPTER = 'kobo.apps.accounts.adapter.AccountAdapter'
ACCOUNT_USERNAME_VALIDATORS = 'kobo.apps.accounts.validators.username_validators'
ACCOUNT_EMAIL_REQUIRED = True
Expand Down