Skip to content

Commit

Permalink
Merge ce56d1f into f72d441
Browse files Browse the repository at this point in the history
  • Loading branch information
hannseman committed Oct 10, 2013
2 parents f72d441 + ce56d1f commit a0ec538
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion djedi/admin/api.py
Expand Up @@ -96,7 +96,7 @@ def post(self, request, uri):
"""
uri = self.decode_uri(uri)
data, meta = self.get_post_data(request)
meta['author'] = request.user.username
meta['author'] = auth.get_username(request.user)
node = cio.set(uri, data, publish=False, **meta)
return self.render_to_json(node)

Expand Down
7 changes: 7 additions & 0 deletions djedi/auth/__init__.py
Expand Up @@ -7,3 +7,10 @@ def has_permission(user):
return True

return False


def get_username(user):
if hasattr(user, 'get_username'):
return user.get_username()
else:
return user.username

0 comments on commit a0ec538

Please sign in to comment.