Open
Conversation
kathmandu777
requested changes
Dec 17, 2022
Comment on lines
+29
to
+33
| cls, | ||
| request: Request, | ||
| id: str, | ||
| text_messages_limit: int, | ||
| image_messages_limit: int, |
Member
There was a problem hiding this comment.
formatter通ってます?
前回通してなかったのかなー?
fastapi/app/api/project.py
Outdated
Comment on lines
115
to
119
| if (project.top_text and | ||
| project.top_image_url and | ||
| project.spotify_uri and | ||
| text_message_count >= 5 and | ||
| image_message_count >= 5): |
Member
There was a problem hiding this comment.
Projectにpropertyとして、can_publishをもたせようか。
APIの方にドメイン知識?を書くのはあまり良くないと思う。あんまり詳しくないからしらんけど。
| image_message_count >= 5): | ||
| project.is_publish = True | ||
| else: | ||
| project.is_publish = False |
Member
There was a problem hiding this comment.
save処理走らないなら、フラグ書き換えの意味はないと思います
Member
There was a problem hiding this comment.
elseの場合は、exceptionがraiseされるから、sync_to_async(project.save)() 実行されないと思う
fastapi/app/models/project.py
Outdated
| ][:limit] | ||
|
|
||
| async def get_image_message_count(self) -> int: | ||
| return MessageImage.objects.count() |
fastapi/app/api/project.py
Outdated
| return [project.id for project in Project.objects.all()] | ||
|
|
||
| @classmethod | ||
| async def post_publication_url(cls, request: Request, project_id: str) -> bool: |
Member
|
masterにrebase必要ですね |
| image_message_count >= 5): | ||
| project.is_publish = True | ||
| else: | ||
| project.is_publish = False |
Member
There was a problem hiding this comment.
elseの場合は、exceptionがraiseされるから、sync_to_async(project.save)() 実行されないと思う
Member
|
conflictしてるから、rebase or merge必要 |
Member
Author
|
formatter問題はたしかに解決したい |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
プロジェクトが完成したかを判別して, いい感じに完成したURLを返してくれるAPiを作った
Issue number
Close #48
How to check the revision
Points for Review
Remarks