sbp commented on code in PR #336:
URL:
https://github.com/apache/tooling-trusted-releases/pull/336#discussion_r2589221044
##########
atr/post/draft.py:
##########
@@ -37,37 +37,18 @@
import atr.web as web
-class VotePreviewForm(forms.Typed):
- body = forms.textarea("Body")
- # TODO: Validate the vote duration again?
- # Probably not necessary in a preview
- # Note that tasks/vote.py does not use this form
- vote_duration = forms.integer("Vote duration")
+class VotePreviewForm(form.Form):
+ body: str = form.label("Body", widget=form.Widget.TEXTAREA)
+ # Note: this does not provide any vote duration validation; this simply
displays a preview to the user
+ vote_duration: form.Int = form.label("Vote duration")
[email protected]("/draft/delete")
-async def delete(session: web.Committer) -> web.WerkzeugResponse:
[email protected]("/compose/<project_name>/<version_name>")
[email protected](shared.draft.DeleteForm)
+async def delete(
+ session: web.Committer, form: shared.draft.DeleteForm, project_name: str,
version_name: str
Review Comment:
Let's call this `delete_form` so as not to look like `atr.form`.
##########
atr/post/draft.py:
##########
@@ -92,19 +73,14 @@ async def delete(session: web.Committer) ->
web.WerkzeugResponse:
@post.committer("/draft/delete-file/<project_name>/<version_name>")
-async def delete_file(session: web.Committer, project_name: str, version_name:
str) -> web.WerkzeugResponse:
[email protected](shared.draft.DeleteFileForm)
+async def delete_file(
+ session: web.Committer, form: shared.draft.DeleteFileForm, project_name:
str, version_name: str
Review Comment:
Let's call this `delete_file_form`.
##########
atr/post/draft.py:
##########
@@ -243,25 +219,21 @@ async def sbomgen(session: web.Committer, project_name:
str, version_name: str,
@post.committer("/draft/vote/preview/<project_name>/<version_name>")
[email protected](VotePreviewForm)
async def vote_preview(
- session: web.Committer, project_name: str, version_name: str
+ session: web.Committer, form: VotePreviewForm, project_name: str,
version_name: str
Review Comment:
Let's call this `vote_preview_form`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]