Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add version information to form list #676

Merged
merged 3 commits into from
May 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion onadata/libs/serializers/xform_serializer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# coding: utf-8
from __future__ import unicode_literals, print_function, division, absolute_import

import json

from rest_framework import serializers
from rest_framework.reverse import reverse

Expand Down Expand Up @@ -82,7 +84,12 @@ class XFormListSerializer(serializers.Serializer):
manifestUrl = serializers.SerializerMethodField('get_manifest_url')

def get_version(self, obj):
return None
# Returns version data
# The data returned may vary depending on the contents of the
# version field in the settings of the XLS file when the asset was
# created or updated
obj_json = json.loads(obj.json)
return obj_json.get('version')

@check_obj
def get_hash(self, obj):
Expand Down