From 607fa37b9845e159ed19ebe1584ed5ec7599de0a Mon Sep 17 00:00:00 2001 From: Kevin Chung Date: Tue, 18 Aug 2020 21:04:55 -0400 Subject: [PATCH] Fix tests --- CTFd/schemas/users.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CTFd/schemas/users.py b/CTFd/schemas/users.py index 2dc95558..785c0986 100644 --- a/CTFd/schemas/users.py +++ b/CTFd/schemas/users.py @@ -192,8 +192,11 @@ class UserSchema(ma.ModelSchema): This validator is used to only allow users to update the field entry for their user. It's not possible to exclude it because without the PK Marshmallow cannot load the right instance """ - current_user = get_current_user() fields = data.get("fields") + if fields is None: + return + + current_user = get_current_user() if is_admin(): user_id = data.get("id")