@@ -56,7 +56,9 @@ class SingleForm(Route):
5656 name = "form"
5757 path = "/{form_id:str}"
5858
59- @api .validate (resp = Response (HTTP_200 = FormWithAncillaryData , HTTP_404 = ErrorMessage ), tags = ["forms" ])
59+ @api .validate (
60+ resp = Response (HTTP_200 = FormWithAncillaryData , HTTP_404 = ErrorMessage ), tags = ["forms" ]
61+ )
6062 async def get (self , request : Request ) -> JSONResponse :
6163 """Returns single form information by ID."""
6264 form_id = request .path_params ["form_id" ].lower ()
@@ -92,29 +94,30 @@ async def get(self, request: Request) -> JSONResponse:
9294 form .submission_precheck .problems .append (
9395 SubmissionProblem (
9496 severity = SubmissionPrecheckSeverity .DANGER ,
95- message = "This form is not open for submissions at the moment."
97+ message = "This form is not open for submissions at the moment." ,
9698 )
9799 )
98100 form .submission_precheck .can_submit = False
99101 elif constants .FormFeatures .UNIQUE_RESPONDER .value in form .features :
100102 user_id = request .user .payload ["id" ] if request .user .is_authenticated else None
101103 if user_id :
102- existing_response = await request .state .db .responses .find_one (
103- {"form_id" : form_id , "user.id" : user_id }
104- )
104+ existing_response = await request .state .db .responses .find_one ({
105+ "form_id" : form_id ,
106+ "user.id" : user_id ,
107+ })
105108 if existing_response :
106109 form .submission_precheck .problems .append (
107110 SubmissionProblem (
108111 severity = SubmissionPrecheckSeverity .DANGER ,
109- message = "You have already submitted a response to this form."
112+ message = "You have already submitted a response to this form." ,
110113 )
111114 )
112115 form .submission_precheck .can_submit = False
113116 else :
114117 form .submission_precheck .problems .append (
115118 SubmissionProblem (
116119 severity = SubmissionPrecheckSeverity .SECONDARY ,
117- message = "You must login at the bottom of the page before submitting this form."
120+ message = "You must login at the bottom of the page before submitting this form." ,
118121 )
119122 )
120123
0 commit comments