-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/pdct 1110 only show entities belonging to user orgcorpus (#135)
* Only show families belonging to user org unless super * Remove debug * Placate pyright * Bump to 2.6.1
- Loading branch information
1 parent
7959e55
commit ad1a161
Showing
12 changed files
with
132 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "admin_backend" | ||
version = "2.6.0" | ||
version = "2.6.1" | ||
description = "" | ||
authors = ["CPR-dev-team <[email protected]>"] | ||
packages = [{ include = "app" }, { include = "tests" }] | ||
|
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 |
---|---|---|
|
@@ -72,10 +72,10 @@ | |
"category": "UNFCCC", | ||
"status": "Created", | ||
"metadata": {"size": [100], "color": ["blue"]}, | ||
"organisation": "CCLW", | ||
"corpus_import_id": "CCLW.corpus.i00000001.n0000", | ||
"corpus_title": "CCLW national policies", | ||
"corpus_type": "Laws and Policies", | ||
"organisation": "UNFCCC", | ||
"corpus_import_id": "UNFCCC.corpus.i00000001.n0000", | ||
"corpus_title": "UNFCCC Submissions", | ||
"corpus_type": "Intl. agreements", | ||
"slug": "Slug3", | ||
"events": ["E.0.0.3"], | ||
"published_date": "2018-12-24T04:59:33Z", | ||
|
@@ -246,7 +246,8 @@ def _get_org_id_from_name(test_db: Session, name: str) -> int: | |
|
||
def _setup_organisation(test_db: Session) -> tuple[int, int]: | ||
# Now an organisation | ||
org = test_db.query(Organisation).filter(Organisation.name == "CCLW").one() | ||
cclw = test_db.query(Organisation).filter(Organisation.name == "CCLW").one() | ||
unfccc = test_db.query(Organisation).filter(Organisation.name == "UNFCCC").one() | ||
|
||
another_org = Organisation( | ||
name="Another org", | ||
|
@@ -261,52 +262,59 @@ def _setup_organisation(test_db: Session) -> tuple[int, int]: | |
test_db, | ||
"[email protected]", | ||
"CCLWTestUser", | ||
org.id, | ||
cclw.id, | ||
"$2b$12$XXMr7xoEY2fzNiMR3hq.PeJBUUchJyiTfJP.Rt2eq9hsPzt9SXzFC", | ||
) | ||
_add_app_user( | ||
test_db, | ||
"[email protected]", | ||
"NonCCLWTestUser", | ||
"UNFCCCTestUser", | ||
unfccc.id, | ||
"$2b$12$XXMr7xoEY2fzNiMR3hq.PeJBUUchJyiTfJP.Rt2eq9hsPzt9SXzFC", | ||
) | ||
_add_app_user( | ||
test_db, | ||
"[email protected]", | ||
"AnotherTestUser", | ||
another_org.id, | ||
"$2b$12$XXMr7xoEY2fzNiMR3hq.PeJBUUchJyiTfJP.Rt2eq9hsPzt9SXzFC", | ||
) | ||
_add_app_user( | ||
test_db, | ||
"[email protected]", | ||
"TestInactive", | ||
org.id, | ||
cclw.id, | ||
hashed_pass="$2b$12$q.UbWEdeibUuApI2QDbmQeG5WmAPfNmooG1cAoCWjyJXvgiAVVdlK", | ||
is_active=False, | ||
) | ||
_add_app_user( | ||
test_db, "[email protected]", "TestHashedPassEmpty", org.id, hashed_pass="" | ||
test_db, "[email protected]", "TestHashedPassEmpty", cclw.id, hashed_pass="" | ||
) | ||
_add_app_user( | ||
test_db, | ||
"[email protected]", | ||
"TestPassMismatch", | ||
org.id, | ||
cclw.id, | ||
hashed_pass="$2b$12$WZq1rRMvU.Tv1VutLw.rju/Ez5ETkYqP3KufdcSFJm3GTRZP8E52C", | ||
) | ||
_add_app_user( | ||
test_db, | ||
"[email protected]", | ||
"Admin", | ||
org.id, | ||
cclw.id, | ||
hashed_pass="$2b$12$XXMr7xoEY2fzNiMR3hq.PeJBUUchJyiTfJP.Rt2eq9hsPzt9SXzFC", | ||
is_admin=True, | ||
) | ||
_add_app_user( | ||
test_db, | ||
"[email protected]", | ||
"Super", | ||
org.id, | ||
cclw.id, | ||
hashed_pass="$2b$12$XXMr7xoEY2fzNiMR3hq.PeJBUUchJyiTfJP.Rt2eq9hsPzt9SXzFC", | ||
is_super=True, | ||
) | ||
|
||
return cast(int, org.id), cast(int, another_org.id) | ||
return cast(int, cclw.id), cast(int, another_org.id) | ||
|
||
|
||
def _setup_collection_data( | ||
|
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