1. Thomas Waldmann
  2. moin-2.0
  3. Issues
Issue #404 resolved

jinja2.exceptions.UndefinedError UndefinedError: 'fqname' is undefined

RogerHaase
created an issue

If you login and change user setting > wiki appearance and choose either the basic or modernized themes, than you can later select another theme. But if you select the foobar theme and then try to change the theme you get a traceback:

    jinja2.exceptions.UndefinedError

    UndefinedError: 'fqname' is undefined
    Traceback (most recent call last)

        File "D:\Bitbucket\m2-x9-venv-python\lib\site-packages\flask\app.py", line 1836, in __call__

        return self.wsgi_app(environ, start_response)

        File "D:\Bitbucket\m2-x9-venv-python\lib\site-packages\flask\app.py", line 1820, in wsgi_app

        response = self.make_response(self.handle_exception(e))

        File "D:\Bitbucket\m2-x9-venv-python\lib\site-packages\flask\app.py", line 1403, in handle_exception

        reraise(exc_type, exc_value, tb)

        File "D:\Bitbucket\m2-x9-venv-python\lib\site-packages\flask\app.py", line 1817, in wsgi_app

        response = self.full_dispatch_request()

        File "D:\Bitbucket\m2-x9-venv-python\lib\site-packages\flask\app.py", line 1477, in full_dispatch_request

        rv = self.handle_user_exception(e)

        File "D:\Bitbucket\m2-x9-venv-python\lib\site-packages\flask\app.py", line 1381, in handle_user_exception

        reraise(exc_type, exc_value, tb)

        File "D:\Bitbucket\m2-x9-venv-python\lib\site-packages\flask\app.py", line 1475, in full_dispatch_request

        rv = self.dispatch_request()

        File "D:\Bitbucket\m2-x9-venv-python\lib\site-packages\flask\app.py", line 1461, in dispatch_request

        return self.view_functions[rule.endpoint](**req.view_args)

        File "d:\bitbucket\m2-x9\MoinMoin\apps\frontend\views.py", line 1768, in usersettings

        form_objs=forms,

        File "d:\bitbucket\m2-x9\MoinMoin\themes\__init__.py", line 52, in render_template

        return render_theme_template(get_current_theme(), template, **context)

        File "D:\Bitbucket\m2-x9-venv-python\lib\site-packages\flaskext\themes.py", line 445, in render_theme_template

        **context)

        File "D:\Bitbucket\m2-x9-venv-python\lib\site-packages\flask\templating.py", line 128, in render_template

        context, ctx.app)

        File "D:\Bitbucket\m2-x9-venv-python\lib\site-packages\flask\templating.py", line 110, in _render

        rv = template.render(context)

        File "D:\Bitbucket\m2-x9-venv-python\lib\site-packages\jinja2\environment.py", line 969, in render

        return self.environment.handle_exception(exc_info, True)

        File "D:\Bitbucket\m2-x9-venv-python\lib\site-packages\jinja2\environment.py", line 742, in handle_exception

        reraise(exc_type, exc_value, tb)

        File "d:\bitbucket\m2-x9\MoinMoin\themes\foobar\templates\usersettings.html", line 2, in top-level template code

        {% import "usersettings_forms.html" as user_forms %}

        File "d:\bitbucket\m2-x9\MoinMoin\themes\foobar\templates\layout.html", line 6, in top-level template code

        {% import "itemviews.html" as itemviews with context %}

        File "D:\Bitbucket\m2-x9-venv-python\lib\site-packages\jinja2\environment.py", line 1013, in make_module

        return TemplateModule(self, self.new_context(vars, shared, locals))

        File "D:\Bitbucket\m2-x9-venv-python\lib\site-packages\jinja2\environment.py", line 1070, in __init__

        self._body_stream = list(template.root_render_func(context))

        File "d:\bitbucket\m2-x9\MoinMoin\templates\itemviews.html", line 15, in top-level template code

        {%- if endpoint == 'frontend.modify_item' and user.may.write(fqname) %}

        File "d:\bitbucket\m2-x9\MoinMoin\security\__init__.py", line 92, in <lambda>

        return lambda itemname: flaskg.storage.may(itemname, attr, usernames=self.names)

        File "d:\bitbucket\m2-x9\MoinMoin\storage\middleware\protecting.py", line 199, in may

        item = self.get_item(**fqname.query)

        UndefinedError: 'fqname' is undefined

Comments (5)

  1. Log in to comment