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

(0.9.0) 'Portfolio' object has no attribute 'is_invitation_valid' #755

Open
peterkaminski opened this issue Oct 8, 2019 · 1 comment
Open

Comments

@peterkaminski
Copy link
Contributor

peterkaminski commented Oct 8, 2019

What happened: I got a 500 error, 'Portfolio' object has no attribute 'is_invitation_valid', after migration from 0.8.6 to 0.9.0.rc-005.

What I expected: No 500 error. Existing user to be able to accept invite into third user's portfolio based on my invite.

What I did:

  • started with a fresh 0.8.6 instance
  • ran quickstart.sh to populate
  • invited a user test1 to one of the projects
  • stopped the server, checkout'ed 0.9.0.rc-005, did the migration, restarted the server
  • clicked on Ashley's portfolio
  • clicked on green button + Grant access to member
  • selected test1 user and granted access
  • found the invite link in the server log
  • using a different browser already auth'ed to test1, went to the invite link
  • 500 error occurred

Error output below.

AttributeError at /invitation/accept/DuvGDOVet4IM0LM2ChyVGmxO

'Portfolio' object has no attribute 'is_invitation_valid'
Request Method: GET
Request URL: http://localhost:8000/invitation/accept/DuvGDOVet4IM0LM2ChyVGmxO
Django Version: 2.2.4
Exception Type: AttributeError
Exception Value: 'Portfolio' object has no attribute 'is_invitation_valid'
Exception Location: /Users/kaminski/src/govready/govready-q/siteapp/models.py in is_expired, line 1097
Python Executable: /Users/kaminski/src/govready/govready-q/env/bin/python
Python Version: 3.7.4
Python Path: ['/Users/kaminski/src/govready/govready-q', '/Users/kaminski/src/govready/govready-q/env/lib/python37.zip', '/Users/kaminski/src/govready/govready-q/env/lib/python3.7', '/Users/kaminski/src/govready/govready-q/env/lib/python3.7/lib-dynload', '/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7', '/Users/kaminski/src/govready/govready-q/env/lib/python3.7/site-packages']
Server time: Tue, 8 Oct 2019 20:55:58 +0000

Traceback:

File "/Users/kaminski/src/govready/govready-q/env/lib/python3.7/site-packages/django/core/handlers/exception.py" in inner
34. response = get_response(request)

File "/Users/kaminski/src/govready/govready-q/env/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
115. response = self.process_exception_by_middleware(e, request)

File "/Users/kaminski/src/govready/govready-q/env/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
113. response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/Users/kaminski/src/govready/govready-q/siteapp/views.py" in accept_invitation
1337. response = accept_invitation_do_accept(request, inv)

File "/Users/kaminski/src/govready/govready-q/siteapp/views.py" in accept_invitation_do_accept
1369. if inv.is_expired():

File "/Users/kaminski/src/govready/govready-q/siteapp/models.py" in is_expired
1097. if not self.target.is_invitation_valid(self):

Exception Type: AttributeError at /invitation/accept/DuvGDOVet4IM0LM2ChyVGmxO
Exception Value: 'Portfolio' object has no attribute 'is_invitation_valid'

@gregelin
Copy link
Contributor

gregelin commented Oct 8, 2019

@peterkaminski Good edge case test. Nice find.

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

2 participants