Fix unsafe behavior in marshmallow class for contributions.
This commit is contained in:
parent
5cb08a1f14
commit
8a193756b3
|
@ -736,11 +736,11 @@ class ProposalContributionSchema(ma.Schema):
|
|||
}
|
||||
|
||||
def get_is_anonymous(self, obj):
|
||||
return not obj.user
|
||||
return not obj.user_id
|
||||
|
||||
@post_dump
|
||||
def stub_anonymous_user(self, data):
|
||||
if not data['user']:
|
||||
if 'user' in data and data['user'] is None:
|
||||
data['user'] = anonymous_user
|
||||
return data
|
||||
|
||||
|
|
Loading…
Reference in New Issue