Skip to content

Commit

Permalink
Improve logic
Browse files Browse the repository at this point in the history
Signed-off-by: Lincoln Simba <[email protected]>
  • Loading branch information
lincmba committed Jan 23, 2019
1 parent 24dde26 commit a758205
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions onadata/apps/api/viewsets/xform_viewset.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,15 +412,15 @@ def enketo(self, request, **kwargs):
except EnketoError as e:
data = {'message': _(u"Enketo error: %s" % e)}
else:
if url and preview_url:
http_status = status.HTTP_200_OK
data = {"enketo_url": url,
"enketo_preview_url": preview_url}
elif url_type == 'single_submit':
if url_type == 'single_submit':
single_submit_url = get_enketo_single_submit_url(
request, self.object.user.username, self.object.id_string,
xform_pk=self.object.pk)
data = {"single_submit_url": single_submit_url}
elif url and preview_url:
http_status = status.HTTP_200_OK
data = {"enketo_url": url,
"enketo_preview_url": preview_url}

return Response(data, http_status)

Expand Down

0 comments on commit a758205

Please sign in to comment.