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

Visiting "/bulk/ecommerce/": Throw an exception after Django Upgrade. #2367

Closed
asadiqbal08 opened this issue Mar 14, 2022 · 2 comments · Fixed by #2368
Closed

Visiting "/bulk/ecommerce/": Throw an exception after Django Upgrade. #2367

asadiqbal08 opened this issue Mar 14, 2022 · 2 comments · Fixed by #2368
Assignees
Labels
Bug Something isn't working

Comments

@asadiqbal08
Copy link
Contributor

Steps to Reproduce

While testing the Django-3.2 Upgrade changes, We noticed a bug while visiting the ULR /ecommerce/bulk/ hit an endpoint /api/products and generate an exception.

more than one row returned by a subquery used as an expression

Need to look around the query pattern that is causing the issue.

Expected Behavior

No exception should be there while visiting the page.

Actual Behavior

An exception occurred as described above.

Stacktrace

web_1     |     return real_execute(self, sql, params)
web_1     |   File "/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py", line 66, in execute
web_1     |     return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
web_1     |   File "/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
web_1     |     return executor(sql, params, many, context)
web_1     |   File "/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute
web_1     |     return self.cursor.execute(sql, params)
web_1     |   File "/usr/local/lib/python3.7/site-packages/django/db/utils.py", line 90, in __exit__
web_1     |     raise dj_exc_value.with_traceback(traceback) from exc_value
web_1     |   File "/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute
web_1     |     return self.cursor.execute(sql, params)
web_1     | django.db.utils.ProgrammingError: more than one row returned by a subquery used as an expression
@asadiqbal08 asadiqbal08 added the Bug Something isn't working label Mar 14, 2022
@asadiqbal08 asadiqbal08 self-assigned this Mar 14, 2022
@asadiqbal08 asadiqbal08 changed the title Visiting to /bulk/ecommerce/ more than one row returned by a subquery used as an expression Visiting to /bulk/ecommerce/ throw an exception after Django Upgrade. Mar 14, 2022
@asadiqbal08 asadiqbal08 changed the title Visiting to /bulk/ecommerce/ throw an exception after Django Upgrade. Visiting "/bulk/ecommerce/": Throw an exception after Django Upgrade. Mar 14, 2022
@pdpinch
Copy link
Member

pdpinch commented Mar 14, 2022

@briangrossman are you still using this web UI? I think the answer is "yes" but it would be good to confirm.

When we fix this, please be sure to add an appropriate unit test.

@briangrossman
Copy link
Contributor

@asadiqbal08 and @pdpinch
Yes. This is in use.
FYI: Individuals are able to make bulk purchases with a credit card. They receive enrollment codes that they can distribute to learners.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants