-
-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create endpoints to handle organization invitations
- Loading branch information
1 parent
b6a2829
commit c28ad37
Showing
20 changed files
with
1,030 additions
and
10 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,4 +1,24 @@ | ||
INVITE_OWNER_ERROR = ( | ||
'This account is already the owner of {organization_name}. ' | ||
'You cannot join multiple organizations with the same account. ' | ||
'To accept this invitation, you must either transfer ownership of ' | ||
'{organization_name} to a different account or sign in using a different ' | ||
'account with the same email address. If you do not already have another ' | ||
'account, you can create one.' | ||
) | ||
|
||
INVITE_MEMBER_ERROR = ( | ||
'This account is already a member in {organization_name}. ' | ||
'You cannot join multiple organizations with the same account. ' | ||
'To accept this invitation, sign in using a different account with the ' | ||
'same email address. If you do not already have another account, you can ' | ||
'create one.' | ||
) | ||
INVITE_ALREADY_ACCEPTED_ERROR = 'Invite has already been accepted.' | ||
INVITE_NOT_FOUND_ERROR = 'Invite not found.' | ||
ORG_ADMIN_ROLE = 'admin' | ||
ORG_EXTERNAL_ROLE = 'external' | ||
ORG_MEMBER_ROLE = 'member' | ||
ORG_OWNER_ROLE = 'owner' | ||
USER_DOES_NOT_EXIST_ERROR = \ | ||
'User with username or email {invitee} does not exist or is not active.' |
41 changes: 41 additions & 0 deletions
41
...s/organizations/migrations/0010_add_status_and_invitee_role_to_organization_invitation.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,41 @@ | ||
# Generated by Django 4.2.15 on 2025-01-02 12:25 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('organizations', '0009_update_db_state_with_auth_user'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='organizationinvitation', | ||
name='invitee_role', | ||
field=models.CharField( | ||
choices=[('admin', 'Admin'), ('member', 'Member')], | ||
default='member', | ||
max_length=10, | ||
), | ||
), | ||
migrations.AddField( | ||
model_name='organizationinvitation', | ||
name='status', | ||
field=models.CharField( | ||
choices=[ | ||
('accepted', 'Accepted'), | ||
('cancelled', 'Cancelled'), | ||
('complete', 'Complete'), | ||
('declined', 'Declined'), | ||
('expired', 'Expired'), | ||
('failed', 'Failed'), | ||
('in_progress', 'In Progress'), | ||
('pending', 'Pending'), | ||
('resent', 'Resent'), | ||
], | ||
default='pending', | ||
max_length=11, | ||
), | ||
), | ||
] |
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
Oops, something went wrong.