6
6
render_template ,
7
7
request ,
8
8
abort ,
9
+ current_app ,
9
10
)
10
11
11
12
@@ -136,6 +137,9 @@ def ret_error(error: str):
136
137
isbn = isbn ,
137
138
)
138
139
140
+ current_app .logger .info (
141
+ f"{ session ['email' ]} Updated media { media .title } with id { id } "
142
+ )
139
143
return redirect (url_for ("panel_bluep.staff_bluep.staff_panel_alter" ))
140
144
141
145
@@ -177,6 +181,7 @@ def alter_author():
177
181
178
182
update_author (id , author_name )
179
183
184
+ current_app .logger .info (f"{ session ['email' ]} Updated author { author } with id { id } " )
180
185
return redirect (url_for ("panel_bluep.staff_bluep.staff_panel_alter" ))
181
186
182
187
@@ -203,7 +208,7 @@ def ret_error(error: str):
203
208
try :
204
209
isbn = int (isbn )
205
210
except ValueError :
206
- return ret_error ("ISBN has to be Number" )
211
+ return ret_error ("ISBN has to be a Number" )
207
212
208
213
if get_media_id (title ):
209
214
return ret_error ("Media with this Title already exsists" )
@@ -221,14 +226,15 @@ def ret_error(error: str):
221
226
222
227
author = get_author_id (author )
223
228
224
- add_media_item (
229
+ new_id = add_media_item (
225
230
title = title ,
226
231
author_id = author ,
227
232
age_limit = age_limit ,
228
233
media_type_id = media_type ,
229
234
isbn = isbn ,
230
235
)
231
236
237
+ current_app .logger .info (f"{ session ['email' ]} Added media { title } with id { new_id } " )
232
238
return redirect (url_for ("panel_bluep.staff_bluep.staff_panel_addremove" ))
233
239
234
240
@@ -255,8 +261,9 @@ def add_author():
255
261
)
256
262
)
257
263
258
- add_author_to_db (author )
264
+ new_id = add_author_to_db (author )
259
265
266
+ current_app .logger .info (f"{ session ['email' ]} Added author with id { new_id } " )
260
267
return redirect (url_for ("panel_bluep.staff_bluep.staff_panel_addremove" ))
261
268
262
269
@@ -284,4 +291,7 @@ def remove_media():
284
291
)
285
292
286
293
delete_media (media_id )
294
+ current_app .logger .info (
295
+ f"{ session ['email' ]} Removed media { media } with id { media_id } "
296
+ )
287
297
return redirect (url_for ("panel_bluep.staff_bluep.staff_panel_addremove" ))
0 commit comments