Skip to content

Commit

Permalink
Merge pull request #891 from kobotoolbox/purge-non-dict-userprofile-m…
Browse files Browse the repository at this point in the history
…etadata

Purge non-dict UserProfile.metadata when calculating submission counters
  • Loading branch information
LMNTL authored Aug 30, 2023
2 parents ace93da + f31b2a1 commit 6528cc7
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def suspend_submissions_for_user(self, user: 'auth.User'):
) = UserProfile.objects.get_or_create(user_id=user.pk)

# Some old profiles don't have metadata
if user_profile.metadata is None:
if user_profile.metadata is None or not isinstance(user_profile.metadata, dict):
user_profile.metadata = {}

# Set the flag `submissions_suspended` to true if it is not already.
Expand Down

0 comments on commit 6528cc7

Please sign in to comment.