Skip to content

Commit

Permalink
build: rename fmtm-public-beta --> hotosm in all code
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Sep 16, 2024
1 parent 7d93830 commit 8423653
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
6 changes: 3 additions & 3 deletions src/backend/app/auth/roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ async def check_access(
Access is determined based on the user's role and permissions:
- If the user has an 'ADMIN' role, access is granted.
- If the user has a 'READ_ONLY' role, access is denied.
- If the organisation is the public beta, then grant access.
- If the organisation is HOTOSM, then grant access.
- For other roles, access is granted if the user is an organisation manager
for the specified organisation (org_id) or has the specified role
in the specified project (project_id).
Expand Down Expand Up @@ -95,13 +95,13 @@ async def check_access(
SELECT 1
FROM organisations
WHERE (organisations.id = :org_id
AND organisations.slug = 'fmtm-public-beta')
AND organisations.slug = 'hotosm')
OR EXISTS (
SELECT 1
FROM projects
JOIN organisations AS org
ON projects.organisation_id = org.id
WHERE org.slug = 'fmtm-public-beta'
WHERE org.slug = 'hotosm'
AND projects.id = :project_id
)
) THEN true
Expand Down
10 changes: 5 additions & 5 deletions src/backend/app/organisations/organisation_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ async def init_admin_org(db: Session):
-- Start a transaction
BEGIN;
-- Insert FMTM Public Beta organisation
-- Insert HOTOSM organisation
INSERT INTO public.organisations (
name,
slug,
Expand All @@ -58,10 +58,10 @@ async def init_admin_org(db: Session):
odk_central_password
)
VALUES (
'FMTM Public Beta',
'fmtm-public-beta',
'HOTOSM',
'hotosm',
'https://avatars.githubusercontent.com/u/458752?s=280&v=4',
'HOTOSM Public Beta for FMTM.',
'Humanitarian OpenStreetMap Team.',
'https://hotosm.org',
'FREE',
true,
Expand Down Expand Up @@ -106,7 +106,7 @@ async def init_admin_org(db: Session):
-- Set localadmin user as org admin
WITH org_cte AS (
SELECT id FROM public.organisations
WHERE name = 'FMTM Public Beta'
WHERE name = 'HOTOSM'
)
INSERT INTO public.organisation_managers (organisation_id, user_id)
SELECT (SELECT id FROM org_cte), :admin_user_id
Expand Down
6 changes: 1 addition & 5 deletions src/backend/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,7 @@ async def admin_user(db):
@pytest.fixture(scope="function")
def organisation(db):
"""A test organisation."""
return (
db.query(DbOrganisation)
.filter(DbOrganisation.name == "FMTM Public Beta")
.first()
)
return db.query(DbOrganisation).filter(DbOrganisation.name == "HOTOSM").first()


@pytest.fixture(scope="function")
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/e2e/01-create-new-project.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ test('create new project', async ({ browserName, page }) => {
await page.locator('#description').click();
await page.locator('#description').fill('desc');
await page.getByRole('combobox').click();
await page.getByLabel('FMTM Public Beta').click();
await page.getByLabel('HOTOSM').click();
await page.getByRole('button', { name: 'NEXT' }).click();

// 2. Upload Area Step
Expand Down

0 comments on commit 8423653

Please sign in to comment.