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: 'NoneType' object has no attribute 'topics' #2643

Closed
sentry-io bot opened this issue May 9, 2023 · 3 comments
Closed

AttributeError: 'NoneType' object has no attribute 'topics' #2643

sentry-io bot opened this issue May 9, 2023 · 3 comments
Assignees

Comments

@sentry-io
Copy link

sentry-io bot commented May 9, 2023

Sentry Issue: XPRO-65D

AttributeError: 'NoneType' object has no attribute 'topics'
(28 additional frame(s) were not displayed)
...
  File "rest_framework/serializers.py", line 663, in to_representation
    return [
  File "rest_framework/serializers.py", line 664, in <listcomp>
    self.child.to_representation(item) for item in iterable
  File "rest_framework/serializers.py", line 515, in to_representation
    ret[field.field_name] = field.to_representation(attribute)
  File "rest_framework/fields.py", line 1882, in to_representation
    return method(value)
  File "courses/serializers.py", line 158, in get_topics
    [{"name": topic.name} for topic in instance.page.topics.all()],
@pdpinch
Copy link
Member

pdpinch commented May 9, 2023

It looks like we throw an error when someone tries to checkout with a course that doesn't have a topic set. This shouldn't be a requirement.

@arslanashraf7
Copy link
Contributor

#2644 should fix this.

@arslanashraf7
Copy link
Contributor

Closed via #2644

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

3 participants