Skip to content

Commit

Permalink
limit to xform fields used in the templates
Browse files Browse the repository at this point in the history
  • Loading branch information
ukanga committed Apr 27, 2017
1 parent cdecd29 commit e515af1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions onadata/apps/main/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,18 @@ def set_form():
"/%s" % request.user.username)
url = request_url.replace('http://', 'https://')
xforms = XForm.objects.filter(user=content_user)\
.select_related('user')
.select_related('user').only(
'id', 'id_string', 'downloadable', 'shared', 'shared_data',
'user__username', 'num_of_submissions', 'title',
'last_submission_time', 'instances_with_geopoints',
'encrypted', 'date_created')
user_xforms = xforms
# forms shared with user
forms_shared_with = get_forms_shared_with_user(content_user)
forms_shared_with = get_forms_shared_with_user(content_user).only(
'id', 'id_string', 'downloadable', 'shared', 'shared_data',
'user__username', 'num_of_submissions', 'title',
'last_submission_time', 'instances_with_geopoints', 'encrypted',
'date_created')
xforms_list = [
{
'id': 'published',
Expand Down

0 comments on commit e515af1

Please sign in to comment.