Skip to content

Commit

Permalink
Merge branch 'master' of github.com:nursix/eden
Browse files Browse the repository at this point in the history
  • Loading branch information
nursix committed Feb 11, 2021
2 parents 84cb0f2 + 317dc30 commit dbd44e6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/templates/RLP/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def rlp_delegation_read_multiple_orgs():
otable = current.s3db.org_organisation
query = (otable.pe_id.belongs(realms)) & \
(otable.deleted == False)
rows = current.db(query).select(otable.id)
rows = current.db(query).select(otable.id, limitby=(0, len(realms)))
multiple_orgs = len(rows) > 1
org_ids = [row.id for row in rows]

Expand Down
11 changes: 11 additions & 0 deletions modules/templates/RLPPTM/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1141,10 +1141,21 @@ def prep(r):

# Custom form
if is_org_group_admin:
record = r.record
user = auth.user
if record and user:
# Only OrgGroupAdmins managing this organisation can change
# its org group membership (=organisation must be within realm):
realm = user.realms.get(auth.get_system_roles().ORG_GROUP_ADMIN)
groups_readonly = realm is not None and record.pe_id not in realm
else:
groups_readonly = False

groups = S3SQLInlineLink("group",
field = "group_id",
label = T("Organization Group"),
multiple = False,
readonly = groups_readonly,
)
types = S3SQLInlineLink("organisation_type",
field = "organisation_type_id",
Expand Down

0 comments on commit dbd44e6

Please sign in to comment.