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

AttributeError: 'Registration' object has no attribute 'cfg' #26

Open
Phlip opened this issue Oct 17, 2014 · 1 comment
Open

AttributeError: 'Registration' object has no attribute 'cfg' #26

Phlip opened this issue Oct 17, 2014 · 1 comment

Comments

@Phlip
Copy link

Phlip commented Oct 17, 2014

Steps to reproduce - after issue #25, the join.html page starts working. So I fill out the form...

  • Salacias B. Crumb
  • salacias@crumb.com (note I think I have no SMTP for Ptah to test this)
  • password
  • password

Hit Enter (bc that submits many forms;), and get this:

File "C:\Python27\lib\site-packages\pform-0.6.2-py2.7.egg\pform\button.py", line 73, in __call__
  return getattr(context, self.action_name)(*args)
File "c:\users\phlip\downloads\tools\ptahcrowd\ptahcrowd\registration.py", line 63, in register_handler
  if self.cfg['validation']:
AttributeError: 'Registration' object has no attribute 'cfg'

Yes, Python with "magic members" that disappear and reappear is awesome, until it sucks. What am I missing?

@Phlip
Copy link
Author

Phlip commented Oct 17, 2014

I band-aided the problem by reading the settings before using them:

    # validation
    self.cfg = ptah.get_settings(CFG_ID_CROWD, self.request.registry)
    if False: # FIXME TODO  self.cfg['validation']:
        initiate_email_validation(user.email, user, self.request)

Now we just need to figure out what the correct control-flow was to set the cfg correctly.

Also, disregard I knocked out the email validation, bc my project does not yet have a reason to add email servers

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

No branches or pull requests

1 participant