Skip to content

Commit

Permalink
PO: Agency addresses inherit the realm entity from the agency, rather…
Browse files Browse the repository at this point in the history
… than being owned by the agency
  • Loading branch information
nursix committed May 4, 2015
1 parent b1cf4cb commit 9cc8c35
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nursix-1.1.0-devel-2295-g096fcd2 (2015-05-04 10:05:15)
nursix-1.1.0-devel-2296-gb1cf4cb (2015-05-04 15:05:10)
13 changes: 13 additions & 0 deletions modules/templates/IFRC/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,19 @@ def ifrc_realm_entity(table, row):
elif tablename == "pr_group":
use_user_organisation = True

elif tablename == "pr_address":
# Organisation addresses (PO module) inherit the realm entity
# from the organisation
atable = s3db.pr_address
otable = s3db.org_organisation
left = [otable.on(otable.pe_id == atable.pe_id)]
org = db(atable.id == row.id).select(otable.pe_id,
otable.realm_entity,
left=left,
limitby=(0, 1)).first()
if org and org.pe_id:
realm_entity = org.realm_entity

auth = current.auth
user = auth.user
if user:
Expand Down

0 comments on commit 9cc8c35

Please sign in to comment.