Commit ded6dfbf by Muhammad Shoaib

rebased and resolved conflicts

parent 5540bdb3
...@@ -85,7 +85,7 @@ class ProctoredExamStudentAllowanceSerializer(serializers.ModelSerializer): ...@@ -85,7 +85,7 @@ class ProctoredExamStudentAllowanceSerializer(serializers.ModelSerializer):
Serializer for the ProctoredExamStudentAllowance Model. Serializer for the ProctoredExamStudentAllowance Model.
""" """
proctored_exam = ProctoredExamSerializer() proctored_exam = ProctoredExamSerializer()
user = serializers.SerializerMethodField('get_user') user = UserSerializer()
class Meta: class Meta:
""" """
...@@ -95,9 +95,3 @@ class ProctoredExamStudentAllowanceSerializer(serializers.ModelSerializer): ...@@ -95,9 +95,3 @@ class ProctoredExamStudentAllowanceSerializer(serializers.ModelSerializer):
fields = ( fields = (
"id", "created", "modified", "user", "key", "value", "proctored_exam" "id", "created", "modified", "user", "key", "value", "proctored_exam"
) )
def get_user(self, allowance_object):
"""
returns the user object in a serialized form
"""
return UserSerializer(User.objects.get(id=allowance_object.user_id)).data
...@@ -26,12 +26,17 @@ ...@@ -26,12 +26,17 @@
<td> <td>
<%- interpolate(gettext(' %(exam_display_name)s '), { exam_display_name: proctored_exam_allowance.proctored_exam.exam_name }, true) %> <%- interpolate(gettext(' %(exam_display_name)s '), { exam_display_name: proctored_exam_allowance.proctored_exam.exam_name }, true) %>
</td> </td>
<% if (proctored_exam_allowance.user){ %>
<td> <td>
<%- interpolate(gettext(' %(username)s '), { username: proctored_exam_allowance.user.username }, true) %> <%- interpolate(gettext(' %(username)s '), { username: proctored_exam_allowance.user.username }, true) %>
</td> </td>
<td> <td>
<%- interpolate(gettext(' %(email)s '), { email: proctored_exam_allowance.user.email }, true) %> <%- interpolate(gettext(' %(email)s '), { email: proctored_exam_allowance.user.email }, true) %>
</td> </td>
<% }else{ %>
<td>N/A</td>
<td>N/A</td>
<% } %>
<td> <td>
<%- interpolate(gettext(' %(allowance_name)s '), { allowance_name: proctored_exam_allowance.key }, true) %> <%- interpolate(gettext(' %(allowance_name)s '), { allowance_name: proctored_exam_allowance.key }, true) %>
</td> </td>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment