comments: fix extracing auth_user from the passed in objects. Before if auth_user is empty we could relly on INT or STR passed in

This commit is contained in:
Marcin Kuzminski 2018-09-17 19:05:34 +02:00
parent 26ec398df0
commit 5c62c69d2a

View file

@ -191,7 +191,6 @@ class CommentsModel(BaseModel):
:param renderer: pick renderer for this comment
"""
auth_user = auth_user or user
if not text:
log.warning('Missing text for comment, skipping...')
return
@ -203,6 +202,7 @@ class CommentsModel(BaseModel):
repo = self._get_repo(repo)
user = self._get_user(user)
auth_user = auth_user or user
schema = comment_schema.CommentSchema()
validated_kwargs = schema.deserialize(dict(