Browse Source

Fix style issues flagged by pylama

merge-requests/21/head
James Southern 7 years ago
parent
commit
27137407c4
  1. 1
      tildes/tildes/models/comment/comment_notification.py
  2. 6
      tildes/tildes/resources/comment.py
  3. 4
      tildes/tildes/routes.py

1
tildes/tildes/models/comment/comment_notification.py

@ -65,7 +65,6 @@ class CommentNotification(DatabaseModel):
self.comment = comment
self.notification_type = notification_type
def __acl__(self) -> Sequence[Tuple[str, Any, str]]:
"""Pyramid security ACL."""
acl = []

6
tildes/tildes/resources/comment.py

@ -21,6 +21,7 @@ def comment_by_id36(request: Request, comment_id36: str) -> Comment:
return get_resource(request, query)
@use_kwargs(
CommentSchema(only=('comment_id36',)),
locations=('matchdict',),
@ -29,8 +30,11 @@ def notification_by_comment_id36(
request: Request,
comment_id36: str
) -> Comment:
"""Get a comment notification specified by {comment_id36} in the route (or 404)."""
"""Get a comment notification specified by {comment_id36} in the route.
Looks up a comment notification from the request user and a {comment_id36}
specified in the route.
"""
if not request.user:
raise HTTPForbidden

4
tildes/tildes/routes.py

@ -7,8 +7,8 @@ from pyramid.request import Request
from pyramid.security import Allow, Authenticated
from tildes.resources.comment import (
comment_by_id36,
notification_by_comment_id36,
comment_by_id36,
notification_by_comment_id36,
)
from tildes.resources.group import group_by_path
from tildes.resources.message import message_conversation_by_id36

Loading…
Cancel
Save