Skip to content

Commit

Permalink
Merge pull request #188 from sparcs-kaist/develop
Browse files Browse the repository at this point in the history
2021/03/17 v1.1.10 update
  • Loading branch information
jessyoon14 authored Mar 16, 2021
2 parents 8251e8d + 01ce8a5 commit 43d3dcf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 4 additions & 0 deletions apps/core/views/viewsets/article.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class ArticleViewSet(viewsets.ModelViewSet, ActionAPIViewSet):
'partial_update': ArticleUpdateActionSerializer,
'vote_positive': serializers.Serializer,
'vote_negative': serializers.Serializer,
'recent': ArticleListActionSerializer,
}
permission_classes = (
ArticlePermission,
Expand Down Expand Up @@ -79,6 +80,9 @@ def filter_queryset(self, queryset):

queryset = queryset.filter(
article_read_log_set__read_by=self.request.user,
).select_related(
'created_by',
'created_by__profile',
).annotate(
my_last_read_at=models.Subquery(last_read_log_of_the_article.filter(
read_by=self.request.user,
Expand Down
4 changes: 1 addition & 3 deletions apps/user/views/viewsets/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,7 @@ def sso_login_callback(self, request, *args, **kwargs):
)

if not user_profile.user.is_active:
return response.Response(
status=status.HTTP_400_BAD_REQUEST,
)
return redirect(to=reverse('core:InvalidSsoLoginView') + f'?code=not-kaist-and-not-manual&status_code=400')

user_profile.user.last_login = timezone.now()
user_profile.user.save()
Expand Down

0 comments on commit 43d3dcf

Please sign in to comment.