-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add community_type for organisations, add unapproved org list e…
…ndpoint (#1197) * create organisation permission updated to login_required * api to list unapproved organisations * Feat: Added email and community_type field in organisation * fix: changed org_id to mandatory to create project * fix: added organisation_id in payload of create project * fix: await check crs, added email and community type in test organisation * refactor: proper enum field community type in test organisation * build: update community_type migration number & logic * refactor: remove email field from organisation * refactor: remove organisation_id from ProjectUpload model * refactor: remove email from dborg model for conftest * refactor: remove organisation_id from create_project POST json * test: fix remove organisation_id from ProjectUpload * fix: add optional organisation_id to ProjectUpload * feat: add project to org_user_dict if present * fix: extract project from org_user_dict on deletion * test: fix tests to include organisation_id extracted from fixture --------- Co-authored-by: Niraj Adhikari <nrjadkry@gmail.com> Co-authored-by: sujanadh <sujanadh07@gmail.com> Co-authored-by: spwoodcock <sam.woodcock@protonmail.com>
- Loading branch information
1 parent
5ef42b0
commit 941fdde
Showing
13 changed files
with
93 additions
and
16 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
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
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
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
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
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,29 @@ | ||
-- ## Migration to: | ||
-- * Add public.communitytype enum. | ||
-- * Add public.organisation.community_type field. | ||
|
||
-- Start a transaction | ||
BEGIN; | ||
|
||
-- Create communitytype enum if it doesn't exist | ||
DO $$ | ||
BEGIN | ||
IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'communitytype') THEN | ||
CREATE TYPE public.communitytype AS ENUM ( | ||
'OSM_COMMUNITY', | ||
'COMPANY', | ||
'NON_PROFIT', | ||
'UNIVERSITY', | ||
'OTHER' | ||
); | ||
END IF; | ||
END $$; | ||
ALTER TYPE public.communitytype OWNER TO fmtm; | ||
|
||
-- Add the community_type column to organisations table | ||
ALTER TABLE IF EXISTS public.organisations | ||
ADD COLUMN IF NOT EXISTS community_type public.communitytype | ||
DEFAULT 'OSM_COMMUNITY'; | ||
|
||
-- Commit the transaction | ||
COMMIT; |
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,11 @@ | ||
BEGIN; | ||
|
||
-- Remove the community_type column from organisations table | ||
ALTER TABLE public.organisations | ||
DROP COLUMN IF EXISTS community_type; | ||
|
||
-- Drop the communitytype enum | ||
DROP TYPE IF EXISTS public.communitytype; | ||
|
||
-- Commit the transaction | ||
COMMIT; |
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