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

Cannot install plugins on desktop variant #2315

Open
thomersch opened this issue Apr 2, 2024 · 4 comments
Open

Cannot install plugins on desktop variant #2315

thomersch opened this issue Apr 2, 2024 · 4 comments

Comments

@thomersch
Copy link

I've got Datasette Desktop 0.2.2, Datasette: 0.64.1, Python: 3.9.6, SQLite: 3.36.0 and when I open "Install and Manage Plugins", I get an Error 500 "'NoneType' object has no attribute 'day'"

Opening the server log shows this:

 Traceback (most recent call last):
   File "/Users/sthomas/.datasette-app/venv/lib/python3.9/site-packages/datasette/app.py", line 1354, in route_path
     response = await view(request, send)
   File "/Users/sthomas/.datasette-app/venv/lib/python3.9/site-packages/datasette/views/base.py", line 134, in view
     return await self.dispatch_request(request)
   File "/Users/sthomas/.datasette-app/venv/lib/python3.9/site-packages/datasette/views/base.py", line 91, in dispatch_request
     return await handler(request)
   File "/Users/sthomas/.datasette-app/venv/lib/python3.9/site-packages/datasette/views/base.py", line 516, in get
     r = await self.render(templates, request=request, context=context)
   File "/Users/sthomas/.datasette-app/venv/lib/python3.9/site-packages/datasette/views/base.py", line 121, in render
     await self.ds.render_template(
   File "/Users/sthomas/.datasette-app/venv/lib/python3.9/site-packages/datasette/app.py", line 1099, in render_template
     return await template.render_async(template_context)
   File "/Users/sthomas/.datasette-app/venv/lib/python3.9/site-packages/jinja2/environment.py", line 1324, in render_async
     return self.environment.handle_exception()
   File "/Users/sthomas/.datasette-app/venv/lib/python3.9/site-packages/jinja2/environment.py", line 936, in handle_exception
     raise rewrite_traceback_stack(source=source)
   File "/Users/sthomas/.datasette-app/venv/lib/python3.9/site-packages/jinja2/environment.py", line 1321, in <listcomp>
     [n async for n in self.root_render_func(ctx)]  # type: ignore
   File "/Users/sthomas/.datasette-app/venv/lib/python3.9/site-packages/datasette_app_support/templates/table-plugin_directory-plugins.html", line 1, in top-level template code
     {% extends "default:table.html" %}
   File "/Users/sthomas/.datasette-app/venv/lib/python3.9/site-packages/datasette/templates/table.html", line 1, in top-level template code
     {% extends "base.html" %}
   File "/Users/sthomas/.datasette-app/venv/lib/python3.9/site-packages/datasette/templates/base.html", line 60, in top-level template code
     {% block content %}
   File "/Users/sthomas/.datasette-app/venv/lib/python3.9/site-packages/datasette/templates/table.html", line 152, in block 'content'
     {% include custom_table_templates %}
   File "/Users/sthomas/.datasette-app/venv/lib/python3.9/site-packages/datasette_app_support/templates/_table-table-plugin_directory-plugins.html", line 31, in top-level template code
     <p><strong>Latest release:</strong> {{ row.tag_name }} on {{ prettydate(row.latest_release_at) }}</p>
   File "/Users/sthomas/.datasette-app/venv/lib/python3.9/site-packages/datasette_app_support/__init__.py", line 355, in prettydate
     day=date.day,
 AttributeError: 'NoneType' object has no attribute 'day'
@havardgulldahl
Copy link

I have the same issue as @thomersch . I did the following adhoc change to the prettydate() function, which seems to have solved it. At least the plugin selection screen is shown now.

    try:
        return "{day}{suffix} {month} {year}".format(
            day=date.day,
            month=date.strftime("%B"),
            suffix=suffix(date.day),
            year=date.year,
        )
    except:
        return date

@balabis
Copy link

balabis commented Apr 11, 2024

Same here. Installed the application, wanted to install a plugin and got the same error.

@bigloudjeff
Copy link

I'm having the same issue. Please let us know what we can do to help debug it.

@bigloudjeff
Copy link

I have the same issue as @thomersch . I did the following adhoc change to the prettydate() function, which seems to have solved it. At least the plugin selection screen is shown now.

    try:
        return "{day}{suffix} {month} {year}".format(
            day=date.day,
            month=date.strftime("%B"),
            suffix=suffix(date.day),
            year=date.year,
        )
    except:
        return date

@havardgulldahl can you please give some more details on which file you made the change in. Where would I find that file on disk? Thanks.

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

No branches or pull requests

4 participants