Kallithea issues archive

Issue #376: Kallithea 0.6.0 fails to edit gist: "TypeError: 'Undefined' object is not callable"

Reported by: gnico plus
State: resolved
Created on: 2020-05-22 06:04
Updated on: 2020-05-24 13:25

Description

Kallithea 0.6.0 occurs 500 Internal Server Error when clicking β€œedit” button on a view page of gist file.
Creating gist files and creating repositories, editing files in repositories work well.

TRACEBACK:
Traceback (most recent call last):
  File ""/srv/kallithea/venv/lib/python3.8/site-packages/tg/appwrappers/session.py"", line 71, in __call__
    response = self.next_handler(controller, environ, context)
  File ""/srv/kallithea/venv/lib/python3.8/site-packages/tg/appwrappers/i18n.py"", line 71, in __call__
    return self.next_handler(controller, environ, context)
  File ""/srv/kallithea/venv/lib/python3.8/site-packages/tg/wsgiapp.py"", line 243, in _dispatch
    return controller(environ, context)
  File ""/srv/kallithea/venv/lib/python3.8/site-packages/kallithea/lib/base.py"", line 536, in __call__
    return super(BaseController, self).__call__(environ, context)
  File ""/srv/kallithea/venv/lib/python3.8/site-packages/tg/controllers/dispatcher.py"", line 118, in __call__
    response = self._perform_call(context)
  File ""/srv/kallithea/venv/lib/python3.8/site-packages/tg/controllers/dispatcher.py"", line 107, in _perform_call
    r = self._call(action, params, remainder=remainder, context=context)
  File ""/srv/kallithea/venv/lib/python3.8/site-packages/tg/controllers/decoratedcontroller.py"", line 129, in _call
    output = controller_caller(context_config, bound_controller_callable, remainder, params)
  File ""/srv/kallithea/venv/lib/python3.8/site-packages/tg/controllers/decoration.py"", line 21, in _decorated_controller_caller
    return application_controller_caller(tg_config, controller, remainder, params)
  File ""/srv/kallithea/venv/lib/python3.8/site-packages/tg/configurator/components/dispatch.py"", line 114, in _call_controller
    return controller(*remainder, **params)
  File ""<decorator-gen-8>"", line 2, in edit

  File ""/srv/kallithea/venv/lib/python3.8/site-packages/kallithea/lib/auth.py"", line 614, in __wrapper
    return func(*fargs, **fkwargs)
  File ""/srv/kallithea/venv/lib/python3.8/site-packages/kallithea/controllers/admin/gists.py"", line 208, in edit
    rendered = render('admin/gists/edit.html')
  File ""/srv/kallithea/venv/lib/python3.8/site-packages/kallithea/lib/base.py"", line 63, in render
    return render_template({'url': url}, 'mako', template_path)
  File ""/srv/kallithea/venv/lib/python3.8/site-packages/tg/render.py"", line 208, in render
    kwargs['result'] = render_function(template_name, tg_vars, **kwargs)
  File ""/srv/kallithea/venv/lib/python3.8/site-packages/tg/renderers/mako.py"", line 133, in __call__
    return cached_template(template_name, render_template, cache_key=cache_key,
  File ""/srv/kallithea/venv/lib/python3.8/site-packages/tg/render.py"", line 274, in cached_template
    return render_func()
  File ""/srv/kallithea/venv/lib/python3.8/site-packages/tg/renderers/mako.py"", line 131, in render_template
    return Markup(template.render_unicode(**template_vars))
  File ""/srv/kallithea/venv/lib/python3.8/site-packages/mako/template.py"", line 481, in render_unicode
    return runtime._render(
  File ""/srv/kallithea/venv/lib/python3.8/site-packages/mako/runtime.py"", line 878, in _render
    _render_context(
  File ""/srv/kallithea/venv/lib/python3.8/site-packages/mako/runtime.py"", line 920, in _render_context
    _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
  File ""/srv/kallithea/venv/lib/python3.8/site-packages/mako/runtime.py"", line 947, in _exec_template
    callable_(context, *args, **kwargs)
  File ""_base_root_html"", line 211, in render_body

  File ""_base_base_html"", line 42, in render_body

  File ""admin_gists_edit_html"", line 209, in render_main

TypeError: 'Undefined' object is not callable

Environment

Kallithea 0.6.0 ( got from pip )
Ubuntu 20.04
installed via venv
Python 3.8.2
PostgreSQL

β€Œ

Attachments

Comments

Comment by Mads Kiilerich, on 2020-05-22 13:21

Thanks for reporting.

As a temporary workaround, you can edit kallithea/templates/admin/gists/edit.html and replace safe_str with h.safe_str

Comment by gnico plus, on 2020-05-22 13:28

Thank you for response 😍
It works!

Comment by gnico plus, on 2020-05-24 13:25