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

CenterForOpenScience / SHARE / 14624777953

23 Apr 2025 05:41PM UTC coverage: 79.141% (+0.2%) from 78.893%
14624777953

push

github

web-flow
Merge pull request #858 from CenterForOpenScience/feature/share-cleanup-nograde-2025

[project][ENG-7225] share cleanup 2025 (milestone 1: simplify)

146 of 203 new or added lines in 33 files covered. (71.92%)

76 existing lines in 11 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✔
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