Skip to content

Commit

Permalink
ME: retrieve username from request object and not xform object
Browse files Browse the repository at this point in the history
  • Loading branch information
ivermac committed Jan 12, 2017
1 parent 95aa99a commit 9d5714b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions onadata/apps/api/viewsets/xform_viewset.py
Expand Up @@ -367,7 +367,7 @@ def login(self, request, **kwargs):
def enketo(self, request, **kwargs):
self.object = self.get_object()
form_url = get_form_url(
request, self.object.user.username, settings.ENKETO_PROTOCOL)
request, request.user.username, settings.ENKETO_PROTOCOL)

data = {'message': _(u"Enketo not properly configured.")}
http_status = status.HTTP_400_BAD_REQUEST
Expand All @@ -379,7 +379,7 @@ def enketo(self, request, **kwargs):
self.object, **request_vars)
url = enketo_url(form_url, self.object.id_string, **defaults)
preview_url = get_enketo_preview_url(request,
self.object.user.username,
request.user.username,
self.object.id_string)
except EnketoError as e:
data = {'message': _(u"Enketo error: %s" % e)}
Expand Down

0 comments on commit 9d5714b

Please sign in to comment.