mirror of
https://github.com/Hopiu/django-tos.git
synced 2026-03-16 20:10:24 +00:00
Merge pull request #12 from nicholasserra/nicholasserra-exists
Use exists() instead of filter for a check
This commit is contained in:
commit
7dc9248da8
1 changed files with 2 additions and 1 deletions
|
|
@ -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'
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue