Coverage for src/django_device_bound_sessions/decorators.py: 100%

8 statements  

« prev     ^ index     » next       coverage.py v7.17.2, created at 2026-11-06 02:43 -0600

1from collections.abc import Callable 

2from functools import wraps 

3 

4 

5def dbsc_exempt[**P, R](view_func: Callable[P, R]) -> Callable[P, R]: 

6 """Skip DBSC enforcement and registration offers for this view.""" 

7 

8 @wraps(view_func) 

9 def wrapper(*args: P.args, **kwargs: P.kwargs) -> R: 

10 return view_func(*args, **kwargs) 

11 

12 setattr(wrapper, "dbsc_exempt", True) # noqa: B010 - not a declared attribute 

13 return wrapper