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

NaturalHistoryMuseum / ckanext-userdatasets / #151

26 Jun 2025 01:57PM UTC coverage: 88.525% (-2.1%) from 90.612%
#151

push

coveralls-python

web-flow
Merge de866c4ea into d05155585

11 of 11 new or added lines in 4 files covered. (100.0%)

5 existing lines in 3 files now uncovered.

216 of 244 relevant lines covered (88.52%)

0.89 hits per line

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

91.67
/ckanext/userdatasets/logic/validators.py
1
#!/usr/bin/env python3
2
# encoding: utf-8
3
#
4
# This file is part of ckanext-userdatasets
5
# Created by the Natural History Museum in London, UK
6

7
from ckan.logic.validators import owner_org_validator as default_owner_org_validator
1✔
8
from ckan.plugins import toolkit
1✔
9

10
from ckanext.userdatasets.logic.utils import org_role_is_valid
1✔
11

12

13
def owner_org_validator(key, data, errors, context):
1✔
14
    owner_org = data.get(key)
1✔
15
    if owner_org is not toolkit.missing and owner_org is not None and owner_org != '':
1✔
16
        if context.get('auth_user_obj', None) is not None:
1✔
17
            username = context['auth_user_obj'].name
1✔
18
        else:
19
            username = context['user']
1✔
20

21
        if org_role_is_valid(owner_org, username):
1✔
22
            return
1✔
23

UNCOV
24
    default_owner_org_validator(key, data, errors, context)
×
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