Closed h-vishal closed 4 years ago
builtins.AttributeError AttributeError: 'UserManager' object has no attribute 'UserInvitationClass'
I'm really new to programming with python and I did not understand well. Any solution. Thank you
@Sb1190 you are trying to access the 'UserInvitationClass' member which you should not need to do, StackOverflow is probably a more appropriate forum for you question.
Hi
Running Flask-User 1.0.1.5 on Windows10 with Python 3.7.2 and it is running perfectly.
In my hosting environment Ubuntu 19.04, Python 3.7.3 using the same version of Flask-User, I get the error below.
File "run.py", line 3, in <module> app = create_app() File "/home/lbecker/maranatha/app/__init__.py", line 89, in create_app user_manager = UserManager(app, db, User, UserInvitationClass=UserInvitation) File "/home/lbecker/maranatha/venv/lib/python3.7/site-packages/flask_user/user_manager.py", line 56, in __init__ self.init_app(app, db, UserClass, **kwargs) File "/home/lbecker/maranatha/venv/lib/python3.7/site-packages/flask_user/user_manager.py", line 203, in init_app self._check_settings(app) File "/home/lbecker/maranatha/venv/lib/python3.7/site-packages/flask_user/user_manager.py", line 289, in _check_settings if self.USER_ENABLE_INVITE_USER and not self.UserInvitationClass: AttributeError: 'UserManager' object has no attribute 'UserInvitationClass'
Seein the message of vvch, I looked for the offending line in in user_manager.py and uncommented it. After that the application works fine. Is it possible to have the same version number on modules that differ between Windows and Ubuntu?
I can confirm that what @nerdnum said solves the issue
If a UserInvitationClass is passed in while initializing UserManager, the class member UserInvitationClass is not set which raises a ConfigError. To fix this the UserInvitationClass member should be set when the argument UserInvitationClass is passed in.