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

500 error when searching on the admin page for product #1895

Closed
sentry-io bot opened this issue Sep 15, 2023 · 1 comment · Fixed by #2247
Closed

500 error when searching on the admin page for product #1895

sentry-io bot opened this issue Sep 15, 2023 · 1 comment · Fixed by #2247

Comments

@sentry-io
Copy link

sentry-io bot commented Sep 15, 2023

Sentry Issue: MITXONLINE-36B

FieldError: Cannot resolve keyword 'courseruns' into field. Choices are: basket_item, content_type, content_type_id, courserunproducts, created_on, description, discounts, id, is_active, object_id, price, programruns, purchasable_object, updated_on
(20 additional frame(s) were not displayed)
...
  File "django/db/models/sql/query.py", line 1288, in build_filter
    return self._add_q(
  File "django/db/models/sql/query.py", line 1435, in _add_q
    child_clause, needed_inner = self.build_filter(
  File "django/db/models/sql/query.py", line 1309, in build_filter
    lookups, parts, reffed_expression = self.solve_lookup_type(arg)
  File "django/db/models/sql/query.py", line 1135, in solve_lookup_type
    _, field, _, lookup_parts = self.names_to_path(lookup_splitted, self.get_meta())
  File "django/db/models/sql/query.py", line 1562, in names_to_path
    raise FieldError("Cannot resolve keyword '%s' into field. "
@rachellougee
Copy link
Contributor

rachellougee commented Sep 18, 2023

This is due to the recent change to products' related_query_name in CourseRun model in this PR #1885

 products = GenericRelation(
        "ecommerce.Product", related_query_name="courserunproducts"
    )

I think we just need to update courseruns in https://github.com/mitodl/mitxonline/blob/main/ecommerce/admin.py#L51-L53 to use the new name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants