@@ -94,7 +94,7 @@ async def triggers_ou_create(
94
94
# We will never create a top level organization unit with SDMox.
95
95
# Thus we cannot accept requests with no parent set, or the parent set to the
96
96
# root organization.
97
- parent_uuid = payload .request .get ("parent" , {}).get ("uuid" )
97
+ parent_uuid = ( payload .request .get ("parent" ) or {}).get ("uuid" )
98
98
o_uuid = mora_helper .read_organisation ()
99
99
if not parent_uuid or parent_uuid == o_uuid :
100
100
raise HTTPException (
@@ -157,7 +157,7 @@ async def triggers_address_create(
157
157
"""Create an addresses."""
158
158
dry_run = dry_run or False
159
159
160
- unit_uuid = payload .request .get ("org_unit" , {}).get ("uuid" )
160
+ unit_uuid = ( payload .request .get ("org_unit" ) or {}).get ("uuid" )
161
161
if not unit_uuid : # Probably an employee address
162
162
return {"status" : "NOOP" }
163
163
# We will never create an addresses for units outside non-triggered uuid.
@@ -185,7 +185,7 @@ async def triggers_address_edit(
185
185
"""Edit an address."""
186
186
dry_run = dry_run or False
187
187
188
- unit_uuid = payload .request .get ("org_unit" , {}).get ("uuid" )
188
+ unit_uuid = ( payload .request .get ("org_unit" ) or {}).get ("uuid" )
189
189
if not unit_uuid : # Probably an employee address
190
190
return {"status" : "NOOP" }
191
191
# We will never create an addresses for units outside non-triggered uuid.
0 commit comments