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

NaturalHistoryMuseum / ckanext-userdatasets / #154

26 Jun 2025 02:54PM UTC coverage: 90.164% (-0.4%) from 90.612%
#154

Pull #47

coveralls-python

alycejenni
fix: test truthyness of package.owner_org
Pull Request #47: Accept org admins and editors as members

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

1 existing line in 1 file now uncovered.

220 of 244 relevant lines covered (90.16%)

0.9 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