Skip to content

Commit

Permalink
Use root org as default id
Browse files Browse the repository at this point in the history
  • Loading branch information
bsatoriu committed Aug 27, 2024
1 parent 51f9e42 commit b58b46e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion api/endpoints/organizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,12 @@ def post(self):
if not isinstance(name, str) or not name:
return err_response("Valid org name is required.")

parent_org_id = req_data.get("parent_org_id", None)
root_org = db.session \
.query(Organization_db) \
.filter_by(parent_org_id=None) \
.first()

parent_org_id = req_data.get("parent_org_id", root_org.id)
default_job_limit_count = req_data.get("default_job_limit_count", None)
default_job_limit_hours = req_data.get("default_job_limit_hours", None)

Expand Down

0 comments on commit b58b46e

Please sign in to comment.