Skip to content

Commit

Permalink
chore: remove 2.8 mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
duttonw committed Dec 12, 2024
1 parent f0d8f37 commit 8ed4575
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 46 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,5 @@ Dockerfile.ckan

# bdd tests
/test/screenshots

.idea
2 changes: 1 addition & 1 deletion ckanext/validation/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from ckanext.validation.utils import get_default_schema


def _get_helpers():
def get_helpers():
validators = (
get_validation_badge,
validation_extract_report_from_errors,
Expand Down
24 changes: 19 additions & 5 deletions ckanext/validation/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
import ckantoolkit as tk

import ckan.plugins as p

from ckan.lib.plugins import DefaultTranslation

from . import settings as s, utils, validators
from .helpers import _get_helpers
from . import settings as s, cli, utils, validators, views
from .helpers import get_helpers
from .logic import action, auth
from .model import tables_exist
from .plugin_mixins.flask_plugin import MixinPlugin

log = logging.getLogger(__name__)


class ValidationPlugin(MixinPlugin, p.SingletonPlugin, DefaultTranslation):
class ValidationPlugin(p.SingletonPlugin, DefaultTranslation):
p.implements(p.IConfigurer)
p.implements(p.IActions)
p.implements(p.IAuthFunctions)
Expand All @@ -27,6 +27,18 @@ class ValidationPlugin(MixinPlugin, p.SingletonPlugin, DefaultTranslation):
p.implements(p.ITemplateHelpers)
p.implements(p.IValidators)
p.implements(p.ITranslation, inherit=True)
p.implements(p.IClick)
p.implements(p.IBlueprint)

# IClick

def get_commands(self):
return cli.get_commands()

# IBlueprint

def get_blueprint(self):
return views.get_blueprints()

# ITranslation
def i18n_directory(self):
Expand All @@ -46,6 +58,8 @@ def update_config(self, config_):
Validation pages will not be enabled.
Please run the following to create the database tables:
%s''', init_command)
else:
log.debug(u'Validation tables exist')

tk.add_template_directory(config_, u'templates')
tk.add_resource(u'webassets', 'ckanext-validation')
Expand All @@ -63,7 +77,7 @@ def get_auth_functions(self):
# ITemplateHelpers

def get_helpers(self):
return _get_helpers()
return get_helpers()

# IValidators

Expand Down
Empty file.
20 changes: 0 additions & 20 deletions ckanext/validation/plugin_mixins/flask_plugin.py

This file was deleted.

20 changes: 0 additions & 20 deletions ckanext/validation/plugin_mixins/pylons_plugin.py

This file was deleted.

2 changes: 2 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# -*- coding: utf-8 -*-

pytest_plugins = [
u'ckanext.validation.tests.fixtures',
]

0 comments on commit 8ed4575

Please sign in to comment.