mirror of
https://github.com/ansible/awx.git
synced 2026-01-16 12:20:45 -03:30
Let exceptions better bubble up through reverse_gfk
This commit is contained in:
parent
0479c17256
commit
ab03441133
@ -101,12 +101,12 @@ def reverse_gfk(content_object):
|
||||
for example
|
||||
{ 'organization': '/api/v1/organizations/1/' }
|
||||
'''
|
||||
ret = {}
|
||||
try:
|
||||
ret[camelcase_to_underscore(content_object.__class__.__name__)] = content_object.get_absolute_url()
|
||||
except AttributeError:
|
||||
pass
|
||||
return ret
|
||||
if content_object is None or not hasattr(content_object, 'get_absolute_url'):
|
||||
return {}
|
||||
|
||||
return {
|
||||
camelcase_to_underscore(content_object.__class__.__name__): content_object.get_absolute_url()
|
||||
}
|
||||
|
||||
|
||||
class BaseSerializerMetaclass(serializers.SerializerMetaclass):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user