• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

gcivil-nyu-org / INT2-Monday-Spring2024-Team-2 / 809

04 May 2024 03:36PM UTC coverage: 91.716%. Remained the same
809

Pull #253

travis-pro

web-flow
Merge 26fc3c1b5 into 48120f46f
Pull Request #253: Survey

2015 of 2197 relevant lines covered (91.72%)

1.37 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/TutorRegister/middleware.py
1
from django.conf import settings
2✔
2
from django.shortcuts import redirect
2✔
3
from django.urls import reverse
2✔
4

5

6
class LoginRequiredMiddleware:
2✔
7
    def __init__(self, get_response):
2✔
8
        self.get_response = get_response
1✔
9

10
    def __call__(self, request):
2✔
11
        LOGIN_EXEMPT_URLS = ("auth/", "admin/", "verification/", "contact/")
1✔
12

13
        # Allow homepage access
14
        if request.path_info == "/":
1✔
15
            return self.get_response(request)
1✔
16

17
        if not request.user.is_authenticated:
1✔
18
            path = request.path_info.lstrip("/")
1✔
19
            if not any(path.startswith(allowed) for allowed in LOGIN_EXEMPT_URLS):
1✔
20
                return redirect("TutorRegister:login")
1✔
21

22
        return self.get_response(request)
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc