Commit 747d1d5f authored by Luis García's avatar Luis García
Browse files

Bug fix on survey and phase apis

parent 9fe2ec60
......@@ -20,13 +20,13 @@ class InstitutionSerializer(ModelSerializer):
class PhaseSerializer(ModelSerializer):
status = AsymetricRelatedField.from_serializer(StatusSerializer)()
consultations = SerializerMethodField('get_consultations')
consultations = SerializerMethodField('get_consultations_filter')
class Meta:
model = Phase
fields = ('id', 'slug', 'name', 'image', 'project', 'description', 'order', 'status', 'created', 'consultations')
def get_consultations(self, object):
def get_consultations_filter(self, object):
qs = Consultation.objects.filter(visible=True, phase=object)
serializer = ConsultationSerializer_temp(instance=qs, many=True, read_only=True)
return serializer.data
......
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