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

Default APC plugin settings not being populated #24

Open
alainna opened this issue Apr 12, 2023 · 1 comment
Open

Default APC plugin settings not being populated #24

alainna opened this issue Apr 12, 2023 · 1 comment

Comments

@alainna
Copy link

alainna commented Apr 12, 2023

Describe the bug

The APC Plugin's "Settings" page is inaccessible. It appears to be that default settings are not being created if an admin access the "Settings" page and the journal has no settings already set.

Janeway version
1.4.4-RC-6

To Reproduce
Steps to reproduce the behavior:

  1. Log into a Janeway journal with an account assigned Superuser/Admin permissions
  2. Navigate to the journal's APC Plugin page (/plugins/apc/settings/)
  3. Notice error
  4. Review Sentry report:
    DoesNotExist: SettingValue matching query does not exist.
      File "utils/setting_handler.py", line 109, in get_setting
        journal=journal,
      File "django/db/models/manager.py", line 85, in manager_method
        return getattr(self.get_queryset(), name)(*args, **kwargs)
      File "django/db/models/query.py", line 380, in get
        self.model._meta.object_name
    
    DoesNotExist: ('SettingValue matching query does not exist.', enable_apcs, 'plugin:apc')
      File "django/core/handlers/exception.py", line 41, in inner
        response = get_response(request)
      File "django/core/handlers/base.py", line 249, in _legacy_get_response
        response = self._get_response(request)
      File "django/core/handlers/base.py", line 187, in _get_response
        response = self.process_exception_by_middleware(e, request)
      File "django/core/handlers/base.py", line 185, in _get_response
        response = wrapped_callback(request, *callback_args, **callback_kwargs)
      File "security/decorators.py", line 739, in wrapper
        return func(request, *args, **kwargs)
      File "security/decorators.py", line 64, in wrapper
     return func(request, *args, **kwargs)
      File "security/decorators.py", line 190, in wrapper
        return func(request, *args, **kwargs)
      File "/apps/eschol/janeway/src/plugins/apc/views.py", line 137, in settings
        pretty='Enable APCs',
      File "utils/setting_handler.py", line 204, in get_plugin_setting
        default=True,
      File "utils/setting_handler.py", line 125, in get_setting
        create,
      File "utils/setting_handler.py", line 131, in get_setting
        raise e
      File "utils/setting_handler.py", line 109, in get_setting
        journal=journal,
      File "django/db/models/manager.py", line 85, in manager_method
        return getattr(self.get_queryset(), name)(*args, **kwargs)
      File "django/db/models/query.py", line 380, in get
        self.model._meta.object_name
    
  5. Review admin/core_setting to view enable_apc settings; note lack of setting for demo:

image

  1. Add new setting for enable_apc for journal demo.
  2. Review other apc plugin items and add new setting for each for journal demo where missing
  3. Return to /plugins/apc/settings/ ; the page should successfully load.
@alainna alainna changed the title APC plugin settings not functioning for Janeway journal Default APC plugin settings not being populated Apr 12, 2023
@alainna
Copy link
Author

alainna commented Apr 12, 2023

@hardyoyo has since done some initial testing in a local environment, in which journals are in domain mode -- unlike CDL's stg server, which are in path mode. In addition, the three journals which did have APC plugin settings were all originally set up in domain mode. The two may be related.

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

No branches or pull requests

1 participant