Skip to content

Commit 164f83d

Browse files
author
Kacper Szmigiel
committed
fixed condition for defering
1 parent a6cb6f3 commit 164f83d

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

mypy_django_plugin/lib/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def copy_method_to_another_class(
125125
method_type.ret_type,
126126
allow_placeholder=True)
127127

128-
if bound_return_type is None and not self.defer_till_next_iteration():
128+
if bound_return_type is None and self.defer_till_next_iteration():
129129
raise new_helpers.TypeInfoNotFound(method_node.fullname + ' return type')
130130

131131
assert bound_return_type is not None

test-data/typecheck/managers/test_managers.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -286,17 +286,11 @@
286286
- path: myapp/models.py
287287
content: |
288288
from django.db import models
289-
290289
class ManagerA(models.Manager):
291290
def do_something(self) -> "ModelB":
292291
return ModelB.objects.create(movie="There's something about mypy")
293-
294-
295292
class ModelA(models.Model):
296293
title = models.TextField()
297-
298294
objects = ManagerA()
299-
300-
301295
class ModelB(models.Model):
302296
movie = models.TextField()

0 commit comments

Comments
 (0)