Skip to content

Commit

Permalink
get_orgs_forms now returns all orgs
Browse files Browse the repository at this point in the history
  • Loading branch information
gurman10 committed Jan 3, 2025
1 parent 0e0bc95 commit 93b4bb7
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions ckanext/bcgov/util/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import ckanext.bcgov
from ckanext.bcgov.version import version
from ckanext.bcgov.util.git import get_short_commit_id
from ckanext.bcgov.logic.action import organization_or_group_list_related

NotFound = logic.NotFound
get_action = logic.get_action
Expand Down Expand Up @@ -366,12 +367,16 @@ def get_edc_org(org_id):

def get_orgs_form(field = None):
"""Designed to get available orgs for scheming fields as parameters cannot be defined in choices_helper functions"""
orgs = []
for org in ckan.lib.helpers.organizations_available('create_dataset'):
orgs.append({
'value': org['id'],
'label': org['display_name']
})
context = {'model': model, 'session': model.Session,
'user': c.user, 'auth_user_obj': c.userobj}
data_dict = {
'is_organization': True,
'all_fields': True
}
all_orgs_data = (organization_or_group_list_related(context, data_dict))

orgs = [{'id': org['id'], 'display_name': org['display_name']} for org in all_orgs_data]

return orgs


Expand Down

0 comments on commit 93b4bb7

Please sign in to comment.