Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only resources which files exist are available as job inputs #920

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ export default class ControllerWorkflowBuilder extends BaseController
{
var project = Radio.channel('rodan').request(RODAN_EVENTS.REQUEST__PROJECT_GET_ACTIVE);
var resourceTypeURLs = this._getCompatibleResourceTypeURLs([inputPort]);
var data = {project: project.id, resource_type__in: ''};
var data = {project: project.id, resource_type__in: '', file_exists: 'True'};
var globalResourceTypes = Radio.channel('rodan').request(RODAN_EVENTS.REQUEST__GLOBAL_RESOURCETYPE_COLLECTION);
var first = true;
for (var index in resourceTypeURLs)
Expand Down
6 changes: 6 additions & 0 deletions rodan-main/code/rodan/views/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ def get_queryset(self):
elif uploaded == u'False':
condition &= Q(origin__isnull=False)

file_exists = self.request.query_params.get('file_exists', None)
if file_exists == u'True':
condition &= ~Q(resource_file="")
elif file_exists == u'False':
condition &= Q(resource_file="")

# finding the resourcelist query parameter and adding it to the condition
resource_list_param = self.request.query_params.get('resource_list', None)
if resource_list_param is not None:
Expand Down