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

When user is user_id has exception. #25

Open
whyliu opened this issue Feb 13, 2020 · 0 comments
Open

When user is user_id has exception. #25

whyliu opened this issue Feb 13, 2020 · 0 comments

Comments

@whyliu
Copy link

whyliu commented Feb 13, 2020

  • edx-when version: 0.4
  • Django version: 1.11
  • Python version:2.7
  • Operating System: ubuntu 16.04

Description

[Thu Feb 13 20:27:43.548798 2020] [:error] [pid 25110] File "/edx/apps/edx/venvs/edxapp/lib/python2.7/site-packages/edx_when/api.py", line 82, in get_dates_for_course
[Thu Feb 13 20:27:43.548802 2020] [:error] [pid 25110] user_id = user.id if not user.is_anonymous else ''
[Thu Feb 13 20:27:43.548805 2020] [:error] [pid 25110] AttributeError: 'long' object has no attribute 'is_anonymous'

What I Did

In api.py get_dates_for_course()
...
if isinstance(user, int):
...
In Python2.x, int and long is different type, change to
if not if hasattr(user,'is_anonymous'):

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