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

CenterForOpenScience / SHARE / 14839763329

05 May 2025 03:11PM UTC coverage: 79.141% (-12.6%) from 91.745%
14839763329

push

github

web-flow
Merge pull request #859 from CenterForOpenScience/release/25.2.0

Release/25.2.0 share cleanupgrade (milestone 1: simplify)

147 of 204 new or added lines in 33 files covered. (72.06%)

984 existing lines in 69 files now uncovered.

6101 of 7709 relevant lines covered (79.14%)

1.58 hits per line

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

87.5
/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✔
UNCOV
20
            sentry_sdk.capture_message('\n\t'.join((
×
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✔
UNCOV
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