Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

owsproxy adapter fails #69

Closed
cehbrecht opened this issue May 16, 2019 · 2 comments
Closed

owsproxy adapter fails #69

cehbrecht opened this issue May 16, 2019 · 2 comments
Labels
Milestone

Comments

@cehbrecht
Copy link
Member

In owsproxy.includeme the adapter code for owsproxy_config gets a config but it does expect a request:

get_adapter_factory(config).owsproxy_config(config)

@fmigneault How is the adapter meant to work here?

When I replace the adapter code with:

def includeme(config):
    # from twitcher.adapter import get_adapter_factory
    # get_adapter_factory(config).owsproxy_config(config)
    owsproxy_defaultconfig(config)

... the owsproxy gets correctly initialized.

@cehbrecht cehbrecht added the bug label May 16, 2019
@fmigneault
Copy link
Contributor

fmigneault commented May 16, 2019

@cehbrecht
DefaultAdapter.owsproxy_config calls the same thing :

def owsproxy_config(self, request):
from twitcher.owsproxy import owsproxy_defaultconfig
config = self.configurator_factory(request)
owsproxy_defaultconfig(config)

def configurator_factory(self, request):
settings = get_settings(request)
return Configurator(settings=settings)

The get_settings method allows as input any of pyramid's Configurator, Registry, Request or literal settings dictionary. So the config is resolved to settings in any case. The input name could be updated to reflect a more appropriate behaviour in this specific case.

Probably some configs are lost when creating the 'new' Configurator from settings.

fmigneault added a commit to fmigneault/twitcher that referenced this issue May 16, 2019
cehbrecht added a commit that referenced this issue May 17, 2019
don't lose config if provided directly (#69)
@cehbrecht cehbrecht added this to the 0.5.0 milestone May 17, 2019
@cehbrecht
Copy link
Member Author

fixed by PR #73.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants