Cool, that explains why the `if not xform` is appropriate.

Why do you not agree on the need for a function?  Can you suggest a better way to remove the code duplication between this logic and the same here:
https://github.com/onaio/onadata/pull/71/files#diff-fed46cb43c1a9ee6782846d9574102d6R65
https://github.com/kobotoolbox/kobocat/blob/basic-statistics/api/viewsets/data_viewset.py#L299
https://github.com/kobotoolbox/kobocat/blob/basic-statistics/api/viewsets/submissionstats_viewset.py#L87

I do not think it is acceptable to exactly duplicate this amount of code in two places, let alone in 4 places.

In fact, looking at these methods closer, the owner check could also be pulled out, making the function something like:
```python
xform, owner = get_owner_and_xform_from_request(request, formid)

if xform:
    [logic replacing formid conditional]
else:
   ...
```

The name of the function can be improved, but I believe the reasoning behind refactoring at least the `try` through `raise` of this code make sense.  This is the type of function that would be well suited for a permissions management module.  How about we talk about this tomorrow or Friday and figure out what makes sense?