Skip to content

Commit

Permalink
Merge 6970207 into c2e3704
Browse files Browse the repository at this point in the history
  • Loading branch information
Bibhas committed Jun 25, 2019
2 parents c2e3704 + 6970207 commit a5b3e5b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions baseframe/forms/fields.py
Expand Up @@ -375,8 +375,8 @@ class UserSelectFieldBase(object):
Select a user
"""
def __init__(self, *args, **kwargs):
self.usermodel = kwargs.pop('usermodel')
self.lastuser = kwargs.pop('lastuser')
self.lastuser = kwargs.pop('lastuser', current_app.login_manager)
self.usermodel = kwargs.pop('usermodel', self.lastuser.usermanager.usermodel if self.lastuser else None)
self.separator = kwargs.pop('separator', ',')
if self.lastuser:
self.autocomplete_endpoint = self.lastuser.endpoint_url(current_app.lastuser_config['getuser_autocomplete_endpoint'])
Expand All @@ -391,7 +391,6 @@ def iter_choices(self):
return [(u.userid, u.pickername, True) for u in self.data]

def process_formdata(self, valuelist):
retval = super(UserSelectFieldBase, self).process_formdata(valuelist)
userids = valuelist
# Convert strings in userids into User objects
users = []
Expand All @@ -412,7 +411,6 @@ def process_formdata(self, valuelist):
else:
users = self.usermodel.all(userids=userids)
self.data = users
return retval


class UserSelectField(UserSelectFieldBase, StringField):
Expand Down

0 comments on commit a5b3e5b

Please sign in to comment.