@@ -131,7 +131,9 @@ def register_by_api(self, form, config: OpenKlantConfig):
131
131
if update_data :
132
132
patch_klant (klant , update_data )
133
133
self .log_system_action (
134
- f"patched klant from user with missing fields: { ', ' .join (sorted (update_data .keys ()))} " ,
134
+ "patched klant from user with missing fields: {patched}" .format (
135
+ patched = ", " .join (sorted (update_data .keys ()))
136
+ ),
135
137
user = self .request .user ,
136
138
)
137
139
else :
@@ -148,7 +150,8 @@ def register_by_api(self, form, config: OpenKlantConfig):
148
150
"emailadres" : form .cleaned_data ["email" ],
149
151
"telefoonnummer" : form .cleaned_data ["phonenumber" ],
150
152
}
151
- # registering klanten won't work in e-Suite as it always pulls from BRP (but try anyway and fallback to appending details to tekst if fails)
153
+ # registering klanten won't work in e-Suite as it always pulls from BRP
154
+ # (but try anyway and fallback to appending details to tekst if fails)
152
155
klant = create_klant (data )
153
156
if klant :
154
157
if self .request .user .is_authenticated :
@@ -163,19 +166,27 @@ def register_by_api(self, form, config: OpenKlantConfig):
163
166
subject = form .cleaned_data ["subject" ].subject
164
167
subject_code = form .cleaned_data ["subject" ].subject_code
165
168
question = form .cleaned_data ["question" ]
166
- text = f"{ subject } \n \n { question } "
169
+ text = _ ("Onderwerp: {subject}\n \n {question}" ).format (
170
+ subject = subject , question = question
171
+ )
167
172
168
173
if not klant :
169
174
# if we don't have a BSN and can't create a Klant we'll add contact info to the tekst
170
175
parts = [form .cleaned_data [k ] for k in ("first_name" , "infix" , "last_name" )]
171
176
full_name = " " .join (p for p in parts if p )
172
- text = f"{ text } \n \n Naam: { full_name } "
177
+ text = _ ("{text}\n \n Naam: {full_name}" ).format (
178
+ text = text , full_name = full_name
179
+ )
173
180
174
181
if form .cleaned_data ["email" ]:
175
- text = f"{ text } \n Email: { form .cleaned_data ['email' ]} "
182
+ text = _ ("{text}\n Email: {email}" ).format (
183
+ text = text , email = form .cleaned_data ["email" ]
184
+ )
176
185
177
186
if form .cleaned_data ["phonenumber" ]:
178
- text = f"{ text } \n Telefoonnummer: { form .cleaned_data ['phonenumber' ]} "
187
+ text = _ ("{text}\n Telefoonnummer: {phone}" ).format (
188
+ text = text , phone = form .cleaned_data ["phonenumber" ]
189
+ )
179
190
180
191
self .log_system_action (
181
192
"could not retrieve or create klant for user, appended info to message" ,
0 commit comments