Skip to content

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
jefer94 committed Jun 21, 2024
1 parent 9972dca commit 0ca5594
Showing 1 changed file with 14 additions and 18 deletions.
32 changes: 14 additions & 18 deletions breathecode/assessment/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,28 @@
from rest_framework.permissions import AllowAny
from rest_framework.response import Response
from rest_framework.views import APIView
from breathecode.utils import (
APIViewExtensions,
GenerateLookupsMixin,
)

from breathecode.authenticate.actions import get_user_language
from breathecode.utils import capable_of
from breathecode.utils import APIViewExtensions, GenerateLookupsMixin, capable_of
from breathecode.utils.i18n import translation
from capyc.rest_framework.exceptions import ValidationException

from .models import Assessment, AssessmentThreshold, Option, Question, UserAssessment, Answer, AssessmentLayout
from .models import Answer, Assessment, AssessmentLayout, AssessmentThreshold, Option, Question, UserAssessment
from .serializers import (
AnswerSerializer,
AnswerSmallSerializer,
AssessmentPUTSerializer,
GetAssessmentBigSerializer,
GetAssessmentLayoutSerializer,
GetAssessmentSerializer,
GetAssessmentThresholdSerializer,
OptionSerializer,
QuestionSerializer,
GetAssessmentLayoutSerializer,
SmallUserAssessmentSerializer,
GetUserAssessmentSerializer,
OptionSerializer,
PostUserAssessmentSerializer,
PUTUserAssessmentSerializer,
AnswerSerializer,
AnswerSmallSerializer,
PublicUserAssessmentSerializer,
PUTUserAssessmentSerializer,
QuestionSerializer,
SmallUserAssessmentSerializer,
)


Expand Down Expand Up @@ -406,15 +402,15 @@ def get(self, request, assessment_slug, threshold_id=None):
lookup['academy__id'] = int(param)
else:
lookup['academy__slug'] = param
else:
lookup['academy__isnull'] = True

if 'tag' in self.request.GET:
param = self.request.GET.get('tags')
if param != "all":
if param != 'all':
lookup['tags__icontains'] = param
else:
lookup['tags__in'] = ["", None]

else:
lookup['academy__isnull'] = True
lookup['tags__in'] = ['', None]

items = items.filter(**lookup).order_by('-created_at')

Expand Down

0 comments on commit 0ca5594

Please sign in to comment.