File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -318,8 +318,35 @@ def check_username():
318
318
319
319
return jsonify (user_exists )
320
320
321
+ @user_api .route ("/api/admin/user/update" , methods = ["POST" ])
322
+ # @jwt_ops.admin_required
323
+ def user_update ():
324
+ """Update existing user record
325
+ """
326
+
327
+ post_dict = json .loads (request .data )
328
+
329
+ try :
330
+ username = post_dict ["username" ]
331
+ except :
332
+ return jsonify ("Must specify username" ), 400
333
+
334
+ # We should get 1+ values to update
335
+
336
+ update_dict = {"username" : username }
337
+
338
+ # Need to be a bit defensive here & select what we want instead of taking what we're given
339
+ for key in ["full_name" , "password" , "role" ]:
340
+ try :
341
+ val = post_dict [key ]
342
+ update_dict [key ] = val
343
+ except :
344
+ pass
321
345
346
+ #TODO: WIP
347
+ print (update_dict )
322
348
349
+ return jsonify ("foo" )
323
350
324
351
# TODO: A single do-all update_user()
325
352
@user_api .route ("/api/admin/user/deactivate" , methods = ["POST" ])
You can’t perform that action at this time.
0 commit comments