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

CenterForOpenScience / SHARE / 13726922278

07 Mar 2025 06:27PM UTC coverage: 82.817% (-8.9%) from 91.752%
13726922278

Pull #848

github

web-flow
Merge fc29eb2c8 into cf198c88f
Pull Request #848: [chore] update github actions workflow

16498 of 19921 relevant lines covered (82.82%)

1.66 hits per line

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

93.75
/api/middleware.py
1
from django.conf import settings
2✔
2
from django.http import HttpResponse
2✔
3

4
import sentry_sdk
2✔
5

6
from api.deprecation import get_view_func_deprecation_level, DeprecationLevel
2✔
7

8

9
class DeprecationMiddleware:
2✔
10
    def __init__(self, get_response):
2✔
11
        self.get_response = get_response
2✔
12

13
    def __call__(self, request):
2✔
14
        return self.get_response(request)
2✔
15

16
    def process_view(self, request, view_func, view_args, view_kwargs):
2✔
17
        deprecation_level = get_view_func_deprecation_level(view_func)
2✔
18

19
        if deprecation_level in (DeprecationLevel.LOGGED, DeprecationLevel.HIDDEN):
2✔
20
            sentry_sdk.capture_message('\n\t'.join((
2✔
21
                'Deprecated view usage:',
22
                f'request.path: {request.path}',
23
                f'request.method: {request.method}',
24
                f'deprecation_level: {deprecation_level}',
25
                f'HIDE_DEPRECATED_VIEWS: {settings.HIDE_DEPRECATED_VIEWS}',
26
            )))
27

28
        if settings.HIDE_DEPRECATED_VIEWS and deprecation_level == DeprecationLevel.HIDDEN:
2✔
29
            return HttpResponse(
×
30
                f'This path ({request.path}) has been removed. If you have built something that relies on it, please email us at share-support@osf.io',
31
                status=410,
32
            )
33

34
        return None  # continue processing as normal
2✔
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