File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -174,3 +174,20 @@ def _add_user_to_event(event):
174
174
# - flask_login is not configured
175
175
# - no user is logged in
176
176
pass
177
+
178
+ # The following attribute accesses are ineffective for the general
179
+ # Flask-Login case, because the User interface of Flask-Login does not
180
+ # care about anything but the ID. However, Flask-User (based on
181
+ # Flask-Login) documents a few optional extra attributes.
182
+ #
183
+ # https://github.com/lingthio/Flask-User/blob/a379fa0a281789618c484b459cb41236779b95b1/docs/source/data_models.rst#fixed-data-model-property-names
184
+
185
+ try :
186
+ user_info ["email" ] = user_info ["username" ] = user .email
187
+ except Exception :
188
+ pass
189
+
190
+ try :
191
+ user_info ["username" ] = user .username
192
+ except Exception :
193
+ pass
You can’t perform that action at this time.
0 commit comments