Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

self.UserInvitationClass not set in UserManager() and is checked during intialization #223

Closed
h-vishal opened this issue Jul 23, 2018 · 5 comments · Fixed by #228
Closed

Comments

@h-vishal
Copy link

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.

@Sb1190
Copy link

Sb1190 commented Jul 24, 2018

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

@h-vishal
Copy link
Author

h-vishal commented Aug 1, 2018

@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.

@vvch
Copy link
Contributor

vvch commented Aug 7, 2018

Seems like this attribute was commented out here about a year ago, but is still checked here causing exception (but only if USER_ENABLE_INVITE_USER is set)

vvch added a commit to vvch/Flask-User that referenced this issue Aug 8, 2018
@nerdnum
Copy link

nerdnum commented Aug 8, 2019

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?

@GitMorin
Copy link

GitMorin commented Nov 5, 2019

I can confirm that what @nerdnum said solves the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants