people: invitation object has no attribute security_state

Bug #659926 reported by Jim B. Glenn
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KARL3
Fix Released
Medium
Chris Rossi

Bug Description

reported via error monitor on oxfam prod:

ENTRY
Wed Oct 13 06:12:56 2010
Exception when processing https://karl.oxfam.org.uk/profiles/add.html
Traceback (most recent call last):
  File "/opt/karl/oxfam/3.5.4-0/src/karl/karl/errorlog.py", line 15, in middlewa
re
    return app(environ, start_response)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.zodbconn-0.11-py2.5.egg/repoze/zodbc
onn/connector.py", line 21, in __call__
    result = self.next_app(environ, start_response)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.retry-0.9.4-py2.5.egg/repoze/retry/_
_init__.py", line 88, in __call__
    app_iter = self.application(environ, replace_start_response)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.tm2-1.0a5-py2.5.egg/repoze/tm/__init
__.py", line 23, in __call__
    result = self.application(environ, save_status_and_headers)
  File "/opt/karl/oxfam/3.5.4-0/eggs/Paste-1.7.2-py2.5.egg/paste/registry.py", l
ine 350, in __call__
    app_iter = self.application(environ, start_response)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.who-1.0.15-py2.5.egg/repoze/who/midd
leware.py", line 107, in __call__
    app_iter = app(environ, wrapper.wrap_start_response)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.browserid-0.3-py2.5.egg/repoze/brows
erid/middleware.py", line 127, in __call__
    return self.app(environ, start_response)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/router.
py", line 130, in __call__
    response = view_callable(context, request)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/configu
ration.py", line 1520, in __call__
    return view(context, request)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/configu
ration.py", line 1805, in attr_view
    return view(context, request)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/configu
ration.py", line 1738, in predicate_wrapper
    return view(context, request)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/configu
ration.py", line 1753, in _secured_view
    return view(context, request)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/configu
ration.py", line 1704, in _rendered_view
    response = view(context, request)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg.formish-0.3-py2.5.egg/repoze/bfg
/formish/zcml.py", line 174, in __call__
    return submitted(request, form, controller, self.action, controller)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg.formish-0.3-py2.5.egg/repoze/bfg
/formish/zcml.py", line 213, in submitted
    result = getattr(controller, handler)(converted)
  File "/opt/karl/oxfam/3.5.4-0/src/karl/karl/views/people.py", line 496, in han
dle_submit
    if profile.security_state == 'inactive':
AttributeError: 'Invitation' object has no attribute 'security_state'

ENTRY
Wed Oct 13 06:14:44 2010
Exception when processing https://karl.oxfam.org.uk/profiles/add.html
Traceback (most recent call last):
  File "/opt/karl/oxfam/3.5.4-0/src/karl/karl/errorlog.py", line 15, in middlewa
re
    return app(environ, start_response)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.zodbconn-0.11-py2.5.egg/repoze/zodbc
onn/connector.py", line 21, in __call__
    result = self.next_app(environ, start_response)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.retry-0.9.4-py2.5.egg/repoze/retry/_
_init__.py", line 88, in __call__
    app_iter = self.application(environ, replace_start_response)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.tm2-1.0a5-py2.5.egg/repoze/tm/__init
__.py", line 23, in __call__
    result = self.application(environ, save_status_and_headers)
  File "/opt/karl/oxfam/3.5.4-0/eggs/Paste-1.7.2-py2.5.egg/paste/registry.py", l
ine 350, in __call__
    app_iter = self.application(environ, start_response)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.who-1.0.15-py2.5.egg/repoze/who/midd
leware.py", line 107, in __call__
    app_iter = app(environ, wrapper.wrap_start_response)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.browserid-0.3-py2.5.egg/repoze/brows
erid/middleware.py", line 127, in __call__
    return self.app(environ, start_response)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/router.
py", line 130, in __call__
    response = view_callable(context, request)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/configu
ration.py", line 1520, in __call__
    return view(context, request)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/configu
ration.py", line 1805, in attr_view
    return view(context, request)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/configu
ration.py", line 1738, in predicate_wrapper
    return view(context, request)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/configu
ration.py", line 1753, in _secured_view
    return view(context, request)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/configu
ration.py", line 1704, in _rendered_view
    response = view(context, request)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg.formish-0.3-py2.5.egg/repoze/bfg
/formish/zcml.py", line 174, in __call__
    return submitted(request, form, controller, self.action, controller)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg.formish-0.3-py2.5.egg/repoze/bfg
/formish/zcml.py", line 213, in submitted
    result = getattr(controller, handler)(converted)
  File "/opt/karl/oxfam/3.5.4-0/src/karl/karl/views/people.py", line 496, in han
dle_submit
    if profile.security_state == 'inactive':
AttributeError: 'Invitation' object has no attribute 'security_state'

ENTRY
Wed Oct 13 06:17:12 2010
Exception when processing https://karl.oxfam.org.uk/profiles/add.html
Traceback (most recent call last):
  File "/opt/karl/oxfam/3.5.4-0/src/karl/karl/errorlog.py", line 15, in middlewa
re
    return app(environ, start_response)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.zodbconn-0.11-py2.5.egg/repoze/zodbc
onn/connector.py", line 21, in __call__
    result = self.next_app(environ, start_response)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.retry-0.9.4-py2.5.egg/repoze/retry/_
_init__.py", line 88, in __call__
    app_iter = self.application(environ, replace_start_response)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.tm2-1.0a5-py2.5.egg/repoze/tm/__init
__.py", line 23, in __call__
    result = self.application(environ, save_status_and_headers)
  File "/opt/karl/oxfam/3.5.4-0/eggs/Paste-1.7.2-py2.5.egg/paste/registry.py", l
ine 350, in __call__
    app_iter = self.application(environ, start_response)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.who-1.0.15-py2.5.egg/repoze/who/midd
leware.py", line 107, in __call__
    app_iter = app(environ, wrapper.wrap_start_response)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.browserid-0.3-py2.5.egg/repoze/brows
erid/middleware.py", line 127, in __call__
    return self.app(environ, start_response)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/router.
py", line 130, in __call__
    response = view_callable(context, request)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/configu
ration.py", line 1520, in __call__
    return view(context, request)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/configu
ration.py", line 1805, in attr_view
    return view(context, request)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/configu
ration.py", line 1738, in predicate_wrapper
    return view(context, request)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/configu
ration.py", line 1753, in _secured_view
    return view(context, request)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/configu
ration.py", line 1704, in _rendered_view
    response = view(context, request)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg.formish-0.3-py2.5.egg/repoze/bfg
/formish/zcml.py", line 174, in __call__
    return submitted(request, form, controller, self.action, controller)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg.formish-0.3-py2.5.egg/repoze/bfg
/formish/zcml.py", line 213, in submitted
    result = getattr(controller, handler)(converted)
  File "/opt/karl/oxfam/3.5.4-0/src/karl/karl/views/people.py", line 496, in han
dle_submit
    if profile.security_state == 'inactive':
AttributeError: 'Invitation' object has no attribute 'security_state'

ENTRY
Wed Oct 13 06:17:59 2010
Exception when processing https://karl.oxfam.org.uk/profiles/add.html
Traceback (most recent call last):
  File "/opt/karl/oxfam/3.5.4-0/src/karl/karl/errorlog.py", line 15, in middlewa
re
    return app(environ, start_response)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.zodbconn-0.11-py2.5.egg/repoze/zodbc
onn/connector.py", line 21, in __call__
    result = self.next_app(environ, start_response)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.retry-0.9.4-py2.5.egg/repoze/retry/_
_init__.py", line 88, in __call__
    app_iter = self.application(environ, replace_start_response)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.tm2-1.0a5-py2.5.egg/repoze/tm/__init
__.py", line 23, in __call__
    result = self.application(environ, save_status_and_headers)
  File "/opt/karl/oxfam/3.5.4-0/eggs/Paste-1.7.2-py2.5.egg/paste/registry.py", l
ine 350, in __call__
    app_iter = self.application(environ, start_response)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.who-1.0.15-py2.5.egg/repoze/who/midd
leware.py", line 107, in __call__
    app_iter = app(environ, wrapper.wrap_start_response)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.browserid-0.3-py2.5.egg/repoze/brows
erid/middleware.py", line 127, in __call__
    return self.app(environ, start_response)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/router.
py", line 130, in __call__
    response = view_callable(context, request)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/configu
ration.py", line 1520, in __call__
    return view(context, request)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/configu
ration.py", line 1805, in attr_view
    return view(context, request)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/configu
ration.py", line 1738, in predicate_wrapper
    return view(context, request)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/configu
ration.py", line 1753, in _secured_view
    return view(context, request)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/configu
ration.py", line 1704, in _rendered_view
    response = view(context, request)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg.formish-0.3-py2.5.egg/repoze/bfg
/formish/zcml.py", line 174, in __call__
    return submitted(request, form, controller, self.action, controller)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg.formish-0.3-py2.5.egg/repoze/bfg
/formish/zcml.py", line 213, in submitted
    result = getattr(controller, handler)(converted)
  File "/opt/karl/oxfam/3.5.4-0/src/karl/karl/views/people.py", line 496, in han
dle_submit
    if profile.security_state == 'inactive':
AttributeError: 'Invitation' object has no attribute 'security_state'

ENTRY
Wed Oct 13 08:24:53 2010
Exception when processing https://karl.oxfam.org.uk/profiles/add.html
Traceback (most recent call last):
  File "/opt/karl/oxfam/3.5.4-0/src/karl/karl/errorlog.py", line 15, in middlewa
re
    return app(environ, start_response)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.zodbconn-0.11-py2.5.egg/repoze/zodbc
onn/connector.py", line 21, in __call__
    result = self.next_app(environ, start_response)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.retry-0.9.4-py2.5.egg/repoze/retry/_
_init__.py", line 88, in __call__
    app_iter = self.application(environ, replace_start_response)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.tm2-1.0a5-py2.5.egg/repoze/tm/__init
__.py", line 23, in __call__
    result = self.application(environ, save_status_and_headers)
  File "/opt/karl/oxfam/3.5.4-0/eggs/Paste-1.7.2-py2.5.egg/paste/registry.py", l
ine 350, in __call__
    app_iter = self.application(environ, start_response)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.who-1.0.15-py2.5.egg/repoze/who/midd
leware.py", line 107, in __call__
    app_iter = app(environ, wrapper.wrap_start_response)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.browserid-0.3-py2.5.egg/repoze/brows
erid/middleware.py", line 127, in __call__
    return self.app(environ, start_response)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/router.
py", line 130, in __call__
    response = view_callable(context, request)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/configu
ration.py", line 1520, in __call__
    return view(context, request)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/configu
ration.py", line 1805, in attr_view
    return view(context, request)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/configu
ration.py", line 1738, in predicate_wrapper

    return view(context, request)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/configu
ration.py", line 1753, in _secured_view
    return view(context, request)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/configu
ration.py", line 1704, in _rendered_view
    response = view(context, request)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg.formish-0.3-py2.5.egg/repoze/bfg
/formish/zcml.py", line 174, in __call__
    return submitted(request, form, controller, self.action, controller)
  File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg.formish-0.3-py2.5.egg/repoze/bfg
/formish/zcml.py", line 213, in submitted
    result = getattr(controller, handler)(converted)
  File "/opt/karl/oxfam/3.5.4-0/src/karl/karl/views/people.py", line 496, in han
dle_submit
    if profile.security_state == 'inactive':
AttributeError: 'Invitation' object has no attribute 'security_state'

Revision history for this message
Paul Everitt (paul-agendaless) wrote :

I'm going to pass the buck on analysis on this one and let Tres triage it. Mark this bug anyway you'd like...close it, put in a different milestone (M999 is the "barge"), re-assign, whatever.

Changed in karl3:
assignee: nobody → Tres Seaver (tseaver)
importance: Undecided → Low
milestone: none → m49
Revision history for this message
Tres Seaver (tseaver) wrote :

Neither the karl/views/people.py nor karl/evovle/zodb/evolve25.py does the
Right Thing (TM) when dealing with "old" profiles (ones created before
'security_state' was being assigned).

Assigning to Chris Rossi since he knows the appropriate semantics for
that field.

Changed in karl3:
assignee: Tres Seaver (tseaver) → Chris Rossi (chris-archimedeanco)
importance: Low → Medium
status: New → Confirmed
Revision history for this message
Paul Everitt (paul-agendaless) wrote :

Chris, think you can get to this one this week?

Revision history for this message
Chris Rossi (chris-archimedeanco) wrote : Re: [Bug 659926] Re: people: invitation object has no attribute security_state

Yes.

On Thu, Oct 14, 2010 at 7:19 AM, Paul Everitt <email address hidden> wrote:

> Chris, think you can get to this one this week?
>
>

Revision history for this message
Chris Rossi (chris-archimedeanco) wrote :

What is actually going on here is an administrator is attempting to add a user who has an outstanding invitation to Karl. In other words:

1) Moderator invites external user to join a Karl community.
2) User ignores invitation.
3) Administrator uses "Add User" form to add same user to Karl.
4) Sadness.

The actual problem is not that there is a profile without security_state set, but that our search for profiles with a given email address returns an invitation instead of a profile. The code expects a profile and breaks.

I'm reasonably certain that the correct thing to do here is delete the invitation. A user that has been added by an admin to Karl no longer needs an invitation. It is also possible to see which community the invitation is for and add the user to that community automatically. I'm not 100% convinced this is the right thing to do, but it is open for debate. For the time being I will implement the former but not the latter, unless someone chimes in with input.

Changed in karl3:
status: Confirmed → Fix Committed
Revision history for this message
Paul Everitt (paul-agendaless) wrote :
Download full text (15.4 KiB)

Sounds good to me.

--Paul

On Oct 14, 2010, at 12:49 PM, Chris Rossi wrote:

> What is actually going on here is an administrator is attempting to add
> a user who has an outstanding invitation to Karl. In other words:
>
> 1) Moderator invites external user to join a Karl community.
> 2) User ignores invitation.
> 3) Administrator uses "Add User" form to add same user to Karl.
> 4) Sadness.
>
> The actual problem is not that there is a profile without security_state
> set, but that our search for profiles with a given email address returns
> an invitation instead of a profile. The code expects a profile and
> breaks.
>
> I'm reasonably certain that the correct thing to do here is delete the
> invitation. A user that has been added by an admin to Karl no longer
> needs an invitation. It is also possible to see which community the
> invitation is for and add the user to that community automatically. I'm
> not 100% convinced this is the right thing to do, but it is open for
> debate. For the time being I will implement the former but not the
> latter, unless someone chimes in with input.
>
> --
> people: invitation object has no attribute security_state
> https://bugs.launchpad.net/bugs/659926
> You received this bug notification because you are subscribed to KARL3.
>
> Status in KARL3: Confirmed
>
> Bug description:
> reported via error monitor on oxfam prod:
>
> ENTRY
> Wed Oct 13 06:12:56 2010
> Exception when processing https://karl.oxfam.org.uk/profiles/add.html
> Traceback (most recent call last):
> File "/opt/karl/oxfam/3.5.4-0/src/karl/karl/errorlog.py", line 15, in middlewa
> re
> return app(environ, start_response)
> File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.zodbconn-0.11-py2.5.egg/repoze/zodbc
> onn/connector.py", line 21, in __call__
> result = self.next_app(environ, start_response)
> File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.retry-0.9.4-py2.5.egg/repoze/retry/_
> _init__.py", line 88, in __call__
> app_iter = self.application(environ, replace_start_response)
> File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.tm2-1.0a5-py2.5.egg/repoze/tm/__init
> __.py", line 23, in __call__
> result = self.application(environ, save_status_and_headers)
> File "/opt/karl/oxfam/3.5.4-0/eggs/Paste-1.7.2-py2.5.egg/paste/registry.py", l
> ine 350, in __call__
> app_iter = self.application(environ, start_response)
> File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.who-1.0.15-py2.5.egg/repoze/who/midd
> leware.py", line 107, in __call__
> app_iter = app(environ, wrapper.wrap_start_response)
> File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.browserid-0.3-py2.5.egg/repoze/brows
> erid/middleware.py", line 127, in __call__
> return self.app(environ, start_response)
> File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/router.
> py", line 130, in __call__
> response = view_callable(context, request)
> File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/configu
> ration.py", line 1520, in __call__
> return view(context, request)
> File "/opt/karl/oxfam/3.5.4-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/configu
> ration.py", line 1805, in attr_view
> return view(context, request)
> File "/o...

Revision history for this message
JimPGlenn (jpglenn09) wrote :

released

Changed in karl3:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.