Skip to content

Commit 289d559

Browse files
committed
lint code
1 parent 0a71136 commit 289d559

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+517
-265
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ exclude =
1515
__pycache__,
1616
migrations,
1717
static,
18-
env, # your virtual environment directory
18+
venv, # your virtual environment directory
1919

2020
# Enable checking for complexity
2121
max-complexity = 10
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
from rest_framework import routers
22

33
from .blog import (
4-
PostViewSet,
5-
PostCommentViewSet,
4+
PostViewSet,
5+
PostCommentViewSet,
66
PostCommentLikeViewSet,
77
PostLikeViewSet,
8-
PostDislikeViewSet
8+
PostDislikeViewSet,
99
)
1010

1111
router = routers.DefaultRouter()
1212
router.register("post", PostViewSet, basename="post")
1313
router.register("post_comment", PostCommentViewSet, basename="post-comment")
14-
router.register("post_comment_like", PostCommentLikeViewSet, basename="post-comment-like")
14+
router.register(
15+
"post_comment_like", PostCommentLikeViewSet, basename="post-comment-like"
16+
)
1517
router.register("post_like", PostLikeViewSet, basename="post-like")
1618
router.register("post_dislike", PostDislikeViewSet, basename="post-dislike")
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
from .views import * # noqa
1+
from .views import * # noqa

apps/blog/api_endpoints/blog/Post/serializer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class Meta:
88
model = Post
99
fields = [
1010
"id",
11-
"title",
11+
"title",
1212
"get_absolute_url",
1313
"status",
1414
"description",
@@ -21,4 +21,4 @@ class Meta:
2121
"watching",
2222
"created_at",
2323
"updated_at",
24-
]
24+
]

apps/blog/api_endpoints/blog/Post/views.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
class PostViewSet(viewsets.ModelViewSet):
88
queryset = Post.published.all().order_by("-created_at")
99
serializer_class = PostSerializer
10-
10+
1111
def get_permissions(self):
12-
if self.action in ['list', 'retrieve']:
12+
if self.action in ["list", "retrieve"]:
1313
return [permissions.AllowAny()]
1414
return [permissions.IsAuthenticated()]
15-
16-
__all__ = ("PostViewSet", )
15+
16+
17+
__all__ = ("PostViewSet",)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
from .views import * # noqa
1+
from .views import * # noqa

apps/blog/api_endpoints/blog/PostComment/views.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ class PostCommentViewSet(viewsets.ModelViewSet):
99
serializer_class = PostCommentSerializer
1010

1111
def get_permissions(self):
12-
if self.action in ['list', 'retrieve']:
12+
if self.action in ["list", "retrieve"]:
1313
return [permissions.AllowAny()]
14-
return [permissions.IsAuthenticated()]
15-
16-
__all__ = ("PostCommentViewSet", )
14+
return [permissions.IsAuthenticated()]
15+
16+
17+
__all__ = ("PostCommentViewSet",)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
from .views import * # noqa
1+
from .views import * # noqa

apps/blog/api_endpoints/blog/PostCommentLike/serializers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Meta:
1818
class PostCommentLikeSerializer(serializers.ModelSerializer):
1919
user = MiniPostCommentLikeUserSerializer(read_only=True)
2020
comment = MiniPostCommentLikePostCommentSerializer(read_only=True)
21-
21+
2222
class Meta:
2323
model = PostCommentLike
2424
fields = ["id", "user", "comment"]

apps/blog/api_endpoints/blog/PostCommentLike/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ class PostCommentLikeViewSet(viewsets.ModelViewSet):
99
serializer_class = PostCommentLikeSerializer
1010
permission_classes = [permissions.IsAuthenticated]
1111

12-
__all__ = ("PostCommentLikeViewSet", )
12+
13+
__all__ = ("PostCommentLikeViewSet",)

0 commit comments

Comments
 (0)