We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 8d4131b + c262e77 commit 28833bfCopy full SHA for 28833bf
rest_framework_json_api/utils.py
@@ -132,6 +132,14 @@ def format_value(value, format_type=None):
132
def format_relation_name(value, format_type=None):
133
if format_type is None:
134
format_type = getattr(settings, 'JSON_API_FORMAT_RELATION_KEYS', False)
135
+
136
+ if not format_type:
137
+ # let's keep it the way it was
138
+ return value
139
140
+ # in case the value is going to be changed, make it underscored first
141
+ # because dasherize does not work with a camel cased string
142
+ value = inflection.underscore(value)
143
144
# format_type will never be None here so we can use format_value
145
value = format_value(value, format_type)
0 commit comments