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

Alert profile listing "Remove selected" button needn't be visible when there are no profiles to select. #1800

Closed
lunkwill42 opened this issue Nov 29, 2018 · 0 comments
Assignees
Labels
Milestone

Comments

@lunkwill42
Copy link
Member

If a user, who has never had any alert profile, clicks the "Remove selected" button, the resulting page crashes, because the user has never had an AlertPreference entry.

This is the traceback (NAV 4.8.5):

Internal Server Error: /alertprofiles/profile/remove/
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 111, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python2.7/dist-packages/nav/web/alertprofiles/decorators.py", line 46, in _handler
    return func(request, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/nav/web/alertprofiles/views.py", line 356, in profile_remove
    account=account).active_profile
  File "/usr/lib/python2.7/dist-packages/django/db/models/manager.py", line 92, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/django/db/models/query.py", line 357, in get
    self.model._meta.object_name)
DoesNotExist: AlertPreference matching query does not exist.
@lunkwill42 lunkwill42 added the bug label Nov 29, 2018
@lunkwill42 lunkwill42 added this to the 4.8.6 milestone Nov 29, 2018
@lunkwill42 lunkwill42 self-assigned this Nov 29, 2018
@lunkwill42 lunkwill42 modified the milestones: 4.8.6, 4.9.0 Jan 28, 2019
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

1 participant