Coverage for src/ptf_tools/utils.py: 80%

8 statements  

« prev     ^ index     » next       coverage.py v7.16.2, created at 2026-10-13 07:53 +0000

1from ptf_tools.templatetags.tools_helpers import get_authorized_collections 

2 

3 

4def is_authorized_editor(user, colid): 

5 colid = colid.replace("/", "") 

6 colids = get_authorized_collections(user) 

7 if "CRMATH" in colids and "CR" not in colids: 7 ↛ 8line 7 didn't jump to line 8 because the condition on line 7 was never true

8 colids.append("CR") 

9 is_authenticated = user.is_active and user.is_authenticated 

10 return is_authenticated and (colid in colids or user.is_staff)