Merge branch 'release_3.1.0' into devel

* release_3.1.0: (633 commits)
  query for failed projects to include canceled
  Style Audit of Host Event Modal
  Remove npm hacks in RPM builder
  Update po files
  Update pot files
  Make sure to delete any nodes that need to be deleted before attempting to associate
  super-user requests to HostDetail go through rbac
  Launch job with prompts fixes
  add notifications to cleanup_jobs
  allow can_add to be called for permission info
  Elaborate on system job default
  i accidentally removed the "-1" from this check, adding it back in
  remove job_event text filters, tweaked RBAC see issue 4958 for the RBAC details
  fixing jshint
  Adding tags was creating this nested array structure which was causing buggy behavior.  This should fix that.
  bump vmware inventory script
  Fix up some unit tests
  moving appendToBottom function elsewhere
  rearranging logic to match integrity of existing logic
  Fixed location of sub-category dropdowns
  ...
This commit is contained in:
Matthew Jones
2017-01-27 20:52:59 -05:00
517 changed files with 39528 additions and 9457 deletions

View File

@@ -13,7 +13,7 @@ from django.utils.translation import ugettext_lazy as _
from rest_framework import exceptions
from rest_framework import metadata
from rest_framework import serializers
from rest_framework.relations import RelatedField
from rest_framework.relations import RelatedField, ManyRelatedField
from rest_framework.request import clone_request
# Ansible Tower
@@ -75,7 +75,7 @@ class Metadata(metadata.SimpleMetadata):
elif getattr(field, 'fields', None):
field_info['children'] = self.get_serializer_info(field)
if hasattr(field, 'choices') and not isinstance(field, RelatedField):
if not isinstance(field, (RelatedField, ManyRelatedField)) and hasattr(field, 'choices'):
field_info['choices'] = [(choice_value, choice_name) for choice_value, choice_name in field.choices.items()]
# Indicate if a field is write-only.
@@ -183,6 +183,10 @@ class Metadata(metadata.SimpleMetadata):
if getattr(view, 'search_fields', None):
metadata['search_fields'] = view.search_fields
# Add related search fields if available from the view.
if getattr(view, 'related_search_fields', None):
metadata['related_search_fields'] = view.related_search_fields
return metadata