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

Fix favicon and opt nav #2316

Merged
merged 4 commits into from
Oct 10, 2023
Merged

Fix favicon and opt nav #2316

merged 4 commits into from
Oct 10, 2023

Conversation

finovy
Copy link
Contributor

@finovy finovy commented Oct 8, 2023

/static/img/favicon.ico not exist,cause error:

Traceback (most recent call last):
  File "/root/.virtualenvs/Archery/lib/python3.8/site-packages/django/contrib/staticfiles/handlers.py", line 54, in get_response
    return self.serve(request)
  File "/root/.virtualenvs/Archery/lib/python3.8/site-packages/django/contrib/staticfiles/handlers.py", line 50, in serve
    return serve(request, self.file_path(request.path), insecure=True)
  File "/root/.virtualenvs/Archery/lib/python3.8/site-packages/django/contrib/staticfiles/views.py", line 37, in serve
    raise Http404("'%s' could not be found" % path)
django.http.response.Http404: 'img/favicon.ico' could not be found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/.virtualenvs/Archery/lib/python3.8/site-packages/django/core/handlers/exception.py", line 165, in get_exception_response
    response = callback(request, exception=exception)
  File "/root/.virtualenvs/Archery/lib/python3.8/site-packages/django/utils/decorators.py", line 134, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/mnt/Archery/common/views.py", line 33, in page_not_found
    return HttpResponseNotFound(render(request, template_name))
  File "/root/.virtualenvs/Archery/lib/python3.8/site-packages/django/shortcuts.py", line 24, in render
    content = loader.render_to_string(template_name, context, request, using=using)
  File "/root/.virtualenvs/Archery/lib/python3.8/site-packages/django/template/loader.py", line 62, in render_to_string
    return template.render(context, request)
  File "/root/.virtualenvs/Archery/lib/python3.8/site-packages/django/template/backends/django.py", line 61, in render
    return self.template.render(context)
  File "/root/.virtualenvs/Archery/lib/python3.8/site-packages/django/template/base.py", line 173, in render
    with context.bind_template(self):
  File "/usr/lib/python3.8/contextlib.py", line 113, in __enter__
    return next(self.gen)
  File "/root/.virtualenvs/Archery/lib/python3.8/site-packages/django/template/context.py", line 254, in bind_template
    updates.update(processor(self.request))
  File "/mnt/Archery/common/utils/global_info.py", line 10, in global_info
    user = request.user
AttributeError: 'WSGIRequest' object has no attribute 'user'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.8/wsgiref/handlers.py", line 137, in run
    self.result = application(self.environ, self.start_response)
  File "/root/.virtualenvs/Archery/lib/python3.8/site-packages/django/contrib/staticfiles/handlers.py", line 81, in __call__
    return super().__call__(environ, start_response)
  File "/root/.virtualenvs/Archery/lib/python3.8/site-packages/django/core/handlers/wsgi.py", line 131, in __call__
    response = self.get_response(request)
  File "/root/.virtualenvs/Archery/lib/python3.8/site-packages/django/contrib/staticfiles/handlers.py", line 56, in get_response
    return response_for_exception(request, e)
  File "/root/.virtualenvs/Archery/lib/python3.8/site-packages/django/core/handlers/exception.py", line 69, in response_for_exception
    response = get_exception_response(
  File "/root/.virtualenvs/Archery/lib/python3.8/site-packages/django/core/handlers/exception.py", line 168, in get_exception_response
    response = handle_uncaught_exception(request, resolver, sys.exc_info())
  File "/root/.virtualenvs/Archery/lib/python3.8/site-packages/django/core/handlers/exception.py", line 186, in handle_uncaught_exception
    return callback(request)
  File "/root/.virtualenvs/Archery/lib/python3.8/site-packages/django/utils/decorators.py", line 134, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/mnt/Archery/common/views.py", line 38, in server_error
    return HttpResponseServerError(render(request, template_name))
  File "/root/.virtualenvs/Archery/lib/python3.8/site-packages/django/shortcuts.py", line 24, in render
    content = loader.render_to_string(template_name, context, request, using=using)
  File "/root/.virtualenvs/Archery/lib/python3.8/site-packages/django/template/loader.py", line 62, in render_to_string
    return template.render(context, request)
  File "/root/.virtualenvs/Archery/lib/python3.8/site-packages/django/template/backends/django.py", line 61, in render
    return self.template.render(context)
  File "/root/.virtualenvs/Archery/lib/python3.8/site-packages/django/template/base.py", line 173, in render
    with context.bind_template(self):
  File "/usr/lib/python3.8/contextlib.py", line 113, in __enter__
    return next(self.gen)
  File "/root/.virtualenvs/Archery/lib/python3.8/site-packages/django/template/context.py", line 254, in bind_template
    updates.update(processor(self.request))
  File "/mnt/Archery/common/utils/global_info.py", line 10, in global_info
    user = request.user

also optimize left nav default collapse

@codecov
Copy link

codecov bot commented Oct 8, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (faf8f98) 75.50% compared to head (13f5391) 75.50%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2316   +/-   ##
=======================================
  Coverage   75.50%   75.50%           
=======================================
  Files         107      107           
  Lines       15460    15460           
=======================================
  Hits        11673    11673           
  Misses       3787     3787           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@LeoQuote LeoQuote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没有看出来 collapse 修改的必要性, 能否详细说明一下

@finovy finovy requested a review from LeoQuote October 10, 2023 06:29
@finovy
Copy link
Contributor Author

finovy commented Oct 10, 2023

每次切换页面都会默认展开再折叠,修改 collapse 实现默认折叠

@LeoQuote
Copy link
Collaborator

我这边试了下, 确实有这样的情况, 谢谢你的pr

@LeoQuote LeoQuote merged commit d4b5ea9 into hhyo:master Oct 10, 2023
10 checks passed
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

Successfully merging this pull request may close these issues.

2 participants