diff --git a/back/backend/serializers.py b/back/backend/serializers.py index d5b0a6d..e169692 100644 --- a/back/backend/serializers.py +++ b/back/backend/serializers.py @@ -8,28 +8,17 @@ from . import models # serializer for reports class ReportSerializer(serializers.ModelSerializer): - # user id is foreign key...? fix this + # user id is foreign key user_id = serializers.PrimaryKeyRelatedField(many=False, read_only=True) class Meta: - fields = list() - model = models.Report - - if model.submitted: - fields = ( - 'user_id', - 'title', - 'date_created', - 'data_submitted', - 'submitted', - ) - else: - fields = ( - 'user_id', - 'title', - 'date_created', - 'submitted', - ) + fields = ( + 'user_id', + 'title', + 'date_created', + # 'data_submitted', + 'submitted', + ) # section serializer