From b296b77a80aa2441258820b8f5615dae040825f8 Mon Sep 17 00:00:00 2001 From: Nicholas Serra Date: Sat, 5 Mar 2016 00:00:28 -0500 Subject: [PATCH] Use exists() on this queryset. --- tos/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tos/models.py b/tos/models.py index 8f16853..dbdffe6 100644 --- a/tos/models.py +++ b/tos/models.py @@ -65,7 +65,8 @@ class TermsOfService(BaseModel): else: if not TermsOfService.objects\ .exclude(id=self.id)\ - .filter(active=True): + .filter(active=True)\ + .exists(): raise NoActiveTermsOfService( u'One of the terms of service must be marked active' )