-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ def add_models_to_namespace(api_namespace): | |
] = mentorship_request_response_body_for_user_dashboard_body | ||
api_namespace.models[user_dashboard_user_details.name] = user_dashboard_user_details | ||
api_namespace.models[task_comment_model.name] = task_comment_model | ||
api_namespace.models[user_detail.name] = user_detail | ||
api_namespace.models[task_comments_model.name] = task_comments_model | ||
|
||
|
||
|
@@ -164,11 +165,19 @@ def add_models_to_namespace(api_namespace): | |
{"comment": fields.String(required=True, description="Task comment.")}, | ||
) | ||
|
||
user_detail = Model( | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
ashokrayal
Author
Owner
|
||
"User model.", | ||
{"id": fields.Integer(required=True, description="User's id."), | ||
This comment has been minimized.
Sorry, something went wrong.
PrashanthPuneriya
|
||
"name": fields.String(required=True, description="User's name.")}, | ||
) | ||
|
||
task_comments_model = Model( | ||
"Task comments model.", | ||
{ | ||
"id": fields.Integer(required=True, description="Task comment's id."), | ||
"user_id": fields.Integer(required=True, description="User's id."), | ||
"sent_by_me":fields.Boolean( | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong. |
||
required=True, description="Comment is done by current user indication"), | ||
"user": fields.Nested(user_detail), | ||
"task_id": fields.Integer(required=True, description="Task's id."), | ||
"relation_id": fields.Integer(required=True, description="Relation's id."), | ||
"creation_date": fields.Float( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -836,12 +836,18 @@ def get(cls, relation_id, task_id): | |
""" | ||
Lists the task comments. | ||
""" | ||
user_id = get_jwt_identity() | ||
|
||
response = TaskCommentDAO.get_all_task_comments_by_task_id( | ||
get_jwt_identity(), task_id, relation_id | ||
user_id, task_id, relation_id | ||
) | ||
|
||
if isinstance(response, tuple): | ||
return response | ||
|
||
for task in response: | ||
This comment has been minimized.
Sorry, something went wrong.
PrashanthPuneriya
|
||
task['user'] = userDAO.get_user(task['user_id']) | ||
task['sent_by_me'] = user_id==task['user_id'] | ||
|
||
else: | ||
return marshal(response, task_comments_model), HTTPStatus.OK |
1 comment
on commit 7a6bcff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue anitab-org#685 fix
Can't we just use dict instead of Model(....)? I think we don't need to create a separate model for it.