Skip to content

ImproperlyConfigured at /api/admin/products/ when a Product has an optiongroup #324

Description

@JulienPalard

Steps to reproduce:

  • set OSCARAPI_BLOCK_ADMIN_API_ACCESS = False to unlock /api/admin/
  • Create a category if you don't have one, I created cat1 from django admin.
  • Create a product class if you don't have one, I created tshirt from django admin.
  • Create a product, I called it tshirt, assigned it to the product class tshirt (I didn't had to assign it a category from django admin).
  • Create an optiongroup, I named it group1, I created it from http://127.0.0.1:8000/admin/catalogue/attributeoptiongroup/
  • Assign an option to the product from the admin by clicking on the "+" near "Product options", named opt1, choosing type: select, and assigning the option to the productgroup. Save the product.

From now, querying /api/admin/products/ gives:

Could not resolve URL for hyperlinked relationship using view name "attributeoptiongroup-detail". You may have failed to include the related model in your API, or incorrectly configured the `lookup_field` attribute on this field.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions