Skip to content

Commit

Permalink
Resolve conflict while cherry picking
Browse files Browse the repository at this point in the history
  • Loading branch information
jimin9038 committed Apr 12, 2022
1 parent ca849e9 commit a39112f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 18 deletions.
1 change: 1 addition & 0 deletions backend/qna/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class Question(models.Model):
create_time = models.DateTimeField(auto_now_add=True)
last_update_time = models.DateTimeField(auto_now=True)
is_resolved = models.BooleanField(default=True)

class Meta:
db_table = "question"
ordering = ("-create_time",)
Expand Down
6 changes: 2 additions & 4 deletions backend/qna/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ class CreateQuestionSerializer(serializers.Serializer):

class EditQuestionSerializer(serializers.Serializer):
id = serializers.IntegerField()

class Meta:
model = Question
fields = ("title", "content")
title = serializers.CharField(max_length=128)
content = serializers.CharField(max_length=1024 * 1024 * 8)


class AnswerSerializer(serializers.Serializer):
Expand Down
2 changes: 1 addition & 1 deletion backend/qna/tests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from copy import deepcopy
import copy
from utils.api.tests import APITestCase
from .models import Question, Answer
from course.models import Course
Expand Down
26 changes: 13 additions & 13 deletions backend/qna/views/professor.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ class QuestionAPI(APIView):
@swagger_auto_schema(
manual_parameters=[
openapi.Parameter(
name="course_id",
in_=openapi.IN_QUERY,
description="Id of course",
required=True,
type=openapi.TYPE_INTEGER,
),
openapi.Parameter(
name="question_id", in_=openapi.IN_QUERY,
type=openapi.TYPE_INTEGER,
required=False
),
],
operation_description="Get Question"
name="course_id",
in_=openapi.IN_QUERY,
description="Id of course",
required=True,
type=openapi.TYPE_INTEGER,
),
openapi.Parameter(
name="question_id", in_=openapi.IN_QUERY,
type=openapi.TYPE_INTEGER,
required=False
),
],
operation_description="Get Question"
)
@admin_role_required
def get(self, request):
Expand Down

0 comments on commit a39112f

Please sign in to comment.