diff options
author | Frederick Muriuki Muriithi | 2023-02-09 16:23:03 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2023-02-09 16:23:03 +0300 |
commit | 83430d7a3a853632eee880cbdd629f114e977757 (patch) | |
tree | 28c8e5e80945f32ac96f12c69b49dbd46cfae1b9 /migrations | |
parent | 500141ca55c128d8ae6e237f21d7d3f9e92d4516 (diff) | |
download | genenetwork3-83430d7a3a853632eee880cbdd629f114e977757.tar.gz |
auth: Reject request to join a group.
* gn3/auth/authorisation/groups/models.py: Modify function to either accept or
reject join requests.
* gn3/auth/authorisation/groups/views.py: Provide endpoint to reject join
requests.
* migrations/auth/20230207_01_r0bkZ-create-group-join-requests-table.py:
Prevent user from applying to join the same group more than once.
Diffstat (limited to 'migrations')
-rw-r--r-- | migrations/auth/20230207_01_r0bkZ-create-group-join-requests-table.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/migrations/auth/20230207_01_r0bkZ-create-group-join-requests-table.py b/migrations/auth/20230207_01_r0bkZ-create-group-join-requests-table.py index 6b06a64..ceae5ea 100644 --- a/migrations/auth/20230207_01_r0bkZ-create-group-join-requests-table.py +++ b/migrations/auth/20230207_01_r0bkZ-create-group-join-requests-table.py @@ -21,6 +21,7 @@ steps = [ ON UPDATE CASCADE ON DELETE CASCADE, FOREIGN KEY (requester_id) REFERENCES users(user_id) ON UPDATE CASCADE ON DELETE CASCADE, + UNIQUE(group_id, requester_id), CHECK (status IN ('PENDING', 'ACCEPTED', 'REJECTED')) ) WITHOUT ROWID """, |