-
Notifications
You must be signed in to change notification settings - Fork 1
Issue/48 add project flag api #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
kathmandu777
left a comment
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.
お願いします!!
| cls, | ||
| request: Request, | ||
| id: str, | ||
| text_messages_limit: int, | ||
| image_messages_limit: int, |
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.
formatter通ってます?
前回通してなかったのかなー?
fastapi/app/api/project.py
Outdated
| if (project.top_text and | ||
| project.top_image_url and | ||
| project.spotify_uri and | ||
| text_message_count >= 5 and | ||
| image_message_count >= 5): |
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.
formatter通ってなさそう
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.
Projectにpropertyとして、can_publishをもたせようか。
APIの方にドメイン知識?を書くのはあまり良くないと思う。あんまり詳しくないからしらんけど。
| image_message_count >= 5): | ||
| project.is_publish = True | ||
| else: | ||
| project.is_publish = False |
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.
save処理走らないなら、フラグ書き換えの意味はないと思います
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.
これ, ifのsave処理走らせてると思う
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.
elseの場合は、exceptionがraiseされるから、sync_to_async(project.save)() 実行されないと思う
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.
その通りだ、修正します
fastapi/app/models/project.py
Outdated
| ][:limit] | ||
|
|
||
| async def get_image_message_count(self) -> int: | ||
| return MessageImage.objects.count() |
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.
上の定義と同じ内容のはずだけど書き方違うね
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.
直します
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: |
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.
publish で良さそうだけどどう思う?
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.
いいと思う
|
masterにrebase必要ですね |
kathmandu777
left a comment
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.
formatte走らない問題は解決したいな
| image_message_count >= 5): | ||
| project.is_publish = True | ||
| else: | ||
| project.is_publish = False |
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.
elseの場合は、exceptionがraiseされるから、sync_to_async(project.save)() 実行されないと思う
|
conflictしてるから、rebase or merge必要 |
|
formatter問題はたしかに解決したい |
Overview
プロジェクトが完成したかを判別して, いい感じに完成したURLを返してくれるAPiを作った
Issue number
Close #48
How to check the revision
Points for Review
Remarks