Skip to content
This repository has been archived by the owner on Jul 9, 2020. It is now read-only.

Commit

Permalink
[controller] Return uuid hex instead of str in register()
Browse files Browse the repository at this point in the history
Searching the str version in the admin doesn't yeld
the expected result, therefore it's better to show
the hex version whenever possible
  • Loading branch information
nemesifier committed Jan 20, 2017
1 parent e0f284a commit 6d75336
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion django_netjsonconfig/controller/generics.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ def post(self, request, *args, **kwargs):
'key: {key}\n' \
'hostname: {name}\n'
s += 'is-new: %s\n' % (int(new))
return ControllerResponse(s.format(**config.__dict__),
attributes = config.__dict__
attributes['id'] = config.pk.hex
return ControllerResponse(s.format(**attributes),
content_type='text/plain',
status=201)

0 comments on commit 6d75336

Please sign in to comment.