mirror of
https://github.com/Hopiu/django-tos.git
synced 2026-03-16 20:10:24 +00:00
Cleaning up unnecessary calls
This commit is contained in:
parent
693d3aeb9d
commit
8359b65c75
2 changed files with 4 additions and 4 deletions
|
|
@ -17,8 +17,8 @@ class TermsOfServiceManager(models.Manager):
|
|||
|
||||
def get_current_tos(self):
|
||||
try:
|
||||
return super(TermsOfServiceManager, self).get_query_set().get(active=True)
|
||||
except TermsOfService.DoesNotExist:
|
||||
return self.get(active=True)
|
||||
except self.model.DoesNotExist:
|
||||
raise NoActiveTermsOfService('Please create an active Terms-of-Service')
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ def check_tos(request, template_name='tos/tos_check.html',
|
|||
|
||||
note=""
|
||||
|
||||
tos =TermsOfService.objects.get_current_tos()
|
||||
tos = TermsOfService.objects.get_current_tos()
|
||||
|
||||
if request.method=="POST":
|
||||
if request.POST.get("accept", "") == "accept":
|
||||
|
|
@ -100,7 +100,7 @@ def login(request, template_name='registration/login.html',
|
|||
|
||||
return render_to_response('tos/tos_check.html', {
|
||||
redirect_field_name: redirect_to,
|
||||
'tos':TermsOfService.objects.get_current_tos()
|
||||
'tos': TermsOfService.objects.get_current_tos()
|
||||
}, context_instance=RequestContext(request))
|
||||
|
||||
else:
|
||||
|
|
|
|||
Loading…
Reference in a new issue