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

update_returning падает если в фильтр передаётся пустой набор #9

Closed
Toika opened this issue May 16, 2019 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Toika
Copy link

Toika commented May 16, 2019

Пример вызова:

Model.objects.filter(id__in=set(), active=False).update_returning(active=True)

Часть трейсбека, непосредственно с момента вызова update_returning:

 update_returning(active=True)
 File "/home/vagrant/venv/lib/python3.6/site-packages/django_pg_returning/manager.py", line 86, in update_returning
   return self._get_returning_qs(sql.UpdateQuery, **updates)
 File "/home/vagrant/venv/lib/python3.6/site-packages/django_pg_returning/manager.py", line 73, in _get_returning_qs
   query_sql, query_params = query.get_compiler(self.db).as_sql()
 File "/home/vagrant/venv/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 1367, in as_sql
   where, params = self.compile(self.query.where)
 File "/home/vagrant/venv/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 390, in compile
   sql, params = node.as_sql(self, self.connection)
 File "/home/vagrant/venv/lib/python3.6/site-packages/django/db/models/sql/where.py", line 99, in as_sql
   raise EmptyResultSet
@M1ha-Shvn M1ha-Shvn added the bug Something isn't working label Jun 1, 2019
@M1ha-Shvn M1ha-Shvn added this to the 1.1.1 milestone Jun 1, 2019
@M1ha-Shvn M1ha-Shvn self-assigned this Jun 1, 2019
@M1ha-Shvn M1ha-Shvn mentioned this issue Jun 1, 2019
@M1ha-Shvn
Copy link
Owner

Released 1.1.1

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

No branches or pull requests

2 participants