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

Bug: Searching Resource Attribute Types throws an error #559

Open
cecilialau6776 opened this issue Aug 2, 2023 · 0 comments · May be fixed by #575
Open

Bug: Searching Resource Attribute Types throws an error #559

cecilialau6776 opened this issue Aug 2, 2023 · 0 comments · May be fixed by #575
Assignees
Labels
bug Something isn't working

Comments

@cecilialau6776
Copy link
Contributor

What happened?

In the admin panel, searching under Resource Attribute Types throws an error

Version

1.1.5

Component

Administration

What browsers are you seeing the problem on?

Firefox

Relevant log output

Environment:


Request Method: GET
Request URL: http://coldfront-dev.rc.rit.edu/admin/resource/resourceattributetype/?q=slurm

Django Version: 3.2.20
Python Version: 3.9.16
Installed Applications:
['django_su',
 'django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.humanize',
 'crispy_forms',
 'sslserver',
 'django_q',
 'simple_history',
 'fontawesome_free',
 'coldfront.core.user',
 'coldfront.core.field_of_science',
 'coldfront.core.utils',
 'coldfront.core.portal',
 'coldfront.core.project',
 'coldfront.core.resource',
 'coldfront.core.allocation',
 'coldfront.core.grant',
 'coldfront.core.publication',
 'coldfront.core.research_output',
 'coldfront.plugins.slurm',
 'coldfront.plugins.xdmod',
 'crispy_bootstrap5',
 'coldfront_plugin_ldap_custom_mapping',
 'coldfront_plugin_ldap_allocs',
 'coldfront_plugin_ru_ldap',
 'coldfront_plugin_slurmtocf']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'simple_history.middleware.HistoryRequestMiddleware',
 'coldfront_plugin_ru_ldap.middleware.CustomHeaderMiddleware']



Traceback (most recent call last):
  File "/srv/coldfront/venv/lib64/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/srv/coldfront/venv/lib64/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/srv/coldfront/venv/lib64/python3.9/site-packages/django/contrib/admin/options.py", line 616, in wrapper
    return self.admin_site.admin_view(view)(*args, **kwargs)
  File "/srv/coldfront/venv/lib64/python3.9/site-packages/django/utils/decorators.py", line 130, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/srv/coldfront/venv/lib64/python3.9/site-packages/django/views/decorators/cache.py", line 44, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/srv/coldfront/venv/lib64/python3.9/site-packages/django/contrib/admin/sites.py", line 232, in inner
    return view(request, *args, **kwargs)
  File "/srv/coldfront/venv/lib64/python3.9/site-packages/django/utils/decorators.py", line 43, in _wrapper
    return bound_method(*args, **kwargs)
  File "/srv/coldfront/venv/lib64/python3.9/site-packages/django/utils/decorators.py", line 130, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/srv/coldfront/venv/lib64/python3.9/site-packages/django/contrib/admin/options.py", line 1697, in changelist_view
    cl = self.get_changelist_instance(request)
  File "/srv/coldfront/venv/lib64/python3.9/site-packages/django/contrib/admin/options.py", line 736, in get_changelist_instance
    return ChangeList(
  File "/srv/coldfront/venv/lib64/python3.9/site-packages/django/contrib/admin/views/main.py", line 99, in __init__
    self.queryset = self.get_queryset(request)
  File "/srv/coldfront/venv/lib64/python3.9/site-packages/django/contrib/admin/views/main.py", line 476, in get_queryset
    qs, search_may_have_duplicates = self.model_admin.get_search_results(
  File "/srv/coldfront/venv/lib64/python3.9/site-packages/django/contrib/admin/options.py", line 1032, in get_search_results
    queryset = queryset.filter(reduce(operator.or_, or_queries))
  File "/srv/coldfront/venv/lib64/python3.9/site-packages/django/db/models/query.py", line 941, in filter
    return self._filter_or_exclude(False, args, kwargs)
  File "/srv/coldfront/venv/lib64/python3.9/site-packages/django/db/models/query.py", line 961, in _filter_or_exclude
    clone._filter_or_exclude_inplace(negate, args, kwargs)
  File "/srv/coldfront/venv/lib64/python3.9/site-packages/django/db/models/query.py", line 968, in _filter_or_exclude_inplace
    self._query.add_q(Q(*args, **kwargs))
  File "/srv/coldfront/venv/lib64/python3.9/site-packages/django/db/models/sql/query.py", line 1416, in add_q
    clause, _ = self._add_q(q_object, self.used_aliases)
  File "/srv/coldfront/venv/lib64/python3.9/site-packages/django/db/models/sql/query.py", line 1435, in _add_q
    child_clause, needed_inner = self.build_filter(
  File "/srv/coldfront/venv/lib64/python3.9/site-packages/django/db/models/sql/query.py", line 1288, in build_filter
    return self._add_q(
  File "/srv/coldfront/venv/lib64/python3.9/site-packages/django/db/models/sql/query.py", line 1435, in _add_q
    child_clause, needed_inner = self.build_filter(
  File "/srv/coldfront/venv/lib64/python3.9/site-packages/django/db/models/sql/query.py", line 1309, in build_filter
    lookups, parts, reffed_expression = self.solve_lookup_type(arg)
  File "/srv/coldfront/venv/lib64/python3.9/site-packages/django/db/models/sql/query.py", line 1135, in solve_lookup_type
    _, field, _, lookup_parts = self.names_to_path(lookup_splitted, self.get_meta())
  File "/srv/coldfront/venv/lib64/python3.9/site-packages/django/db/models/sql/query.py", line 1562, in names_to_path
    raise FieldError("Cannot resolve keyword '%s' into field. "

Exception Type: FieldError at /admin/resource/resourceattributetype/
Exception Value: Cannot resolve keyword 'resource_type' into field. Choices are: attribute_type, attribute_type_id, created, id, is_required, is_unique_per_resource, is_value_unique, modified, name, resourceattribute

Tasks/ user tests when bug is fixed

No response

@cecilialau6776 cecilialau6776 added the bug Something isn't working label Aug 2, 2023
@cecilialau6776 cecilialau6776 changed the title Bug: Bug: Searching Resource Attribute Types throws an error Aug 2, 2023
@ShreyasSridhar24 ShreyasSridhar24 linked a pull request Oct 8, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants