@@ -56,7 +56,9 @@ class SingleForm(Route):
56
56
name = "form"
57
57
path = "/{form_id:str}"
58
58
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
+ )
60
62
async def get (self , request : Request ) -> JSONResponse :
61
63
"""Returns single form information by ID."""
62
64
form_id = request .path_params ["form_id" ].lower ()
@@ -92,29 +94,30 @@ async def get(self, request: Request) -> JSONResponse:
92
94
form .submission_precheck .problems .append (
93
95
SubmissionProblem (
94
96
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." ,
96
98
)
97
99
)
98
100
form .submission_precheck .can_submit = False
99
101
elif constants .FormFeatures .UNIQUE_RESPONDER .value in form .features :
100
102
user_id = request .user .payload ["id" ] if request .user .is_authenticated else None
101
103
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
+ })
105
108
if existing_response :
106
109
form .submission_precheck .problems .append (
107
110
SubmissionProblem (
108
111
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." ,
110
113
)
111
114
)
112
115
form .submission_precheck .can_submit = False
113
116
else :
114
117
form .submission_precheck .problems .append (
115
118
SubmissionProblem (
116
119
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." ,
118
121
)
119
122
)
120
123
0 commit comments