14
246
Fork
You've already forked pyfedi
75

Bug : When we pin a post to the instance, we can edit it anymore #1775

Closed
opened 2026年04月26日 19:11:16 +02:00 by Snoopy34 · 2 comments

info

Piefed : 1.6.19

Steps :

  • Pin a post to the instance
  • Then admin user can't access the post menu anymore. (The three dot button at bottom right)

Post :
https://tarte.nuage-libre.fr/c/meta/p/296841/mise-a-jour-des-rubriques

Error logs

Response Status Error Code 500 from /post/296841/True/options_menu
2026年04月26日 15:54:14,386 ERROR: Exception on /post/296841/True/options_menu [GET] [in /chiffre1/home/piefed/pyfedi/venv/lib/python3.13/site-packages/flask/app.py:875]
Traceback (most recent call last):
 File "/chiffre1/home/piefed/pyfedi/venv/lib/python3.13/site-packages/flask/app.py", line 1511, in wsgi_app
 response = self.full_dispatch_request()
 File "/chiffre1/home/piefed/pyfedi/venv/lib/python3.13/site-packages/flask/app.py", line 919, in full_dispatch_request
 rv = self.handle_user_exception(e)
 File "/chiffre1/home/piefed/pyfedi/venv/lib/python3.13/site-packages/flask/app.py", line 917, in full_dispatch_request
 rv = self.dispatch_request()
 File "/chiffre1/home/piefed/pyfedi/venv/lib/python3.13/site-packages/flask/app.py", line 902, in dispatch_request
 return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
 File "/chiffre1/home/piefed/pyfedi/app/utils.py", line 1550, in decorated_function
 return func(*args, **kwargs)
 File "/chiffre1/home/piefed/pyfedi/app/post/routes.py", line 946, in post_options
 return render_template('post/post_options.html', post=post, existing_bookmark=existing_bookmark, hidden=hidden, offer_markdown_source=offer_markdown_source)
 File "/chiffre1/home/piefed/pyfedi/app/utils.py", line 75, in render_template
 content = flask.render_template(template_name, **context)
 File "/chiffre1/home/piefed/pyfedi/venv/lib/python3.13/site-packages/flask/templating.py", line 150, in render_template
 return _render(app, template, context)
 File "/chiffre1/home/piefed/pyfedi/venv/lib/python3.13/site-packages/flask/templating.py", line 131, in _render
 rv = template.render(context)
 File "/chiffre1/home/piefed/pyfedi/venv/lib/python3.13/site-packages/jinja2/environment.py", line 1295, in render
 self.environment.handle_exception()
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
 File "/chiffre1/home/piefed/pyfedi/venv/lib/python3.13/site-packages/jinja2/environment.py", line 942, in handle_exception
 raise rewrite_traceback_stack(source=source)
 File "/chiffre1/home/piefed/pyfedi/app/templates/post/post_options.html", line 76, in top-level template code
 {{ _('Un-sticky from instance') }}
 ^
 File "/chiffre1/home/piefed/pyfedi/venv/lib/python3.13/site-packages/jinja2/ext.py", line 168, in _gettext_alias
 return __context.call(__context.resolve("gettext"), *args, **kwargs)
 ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/chiffre1/home/piefed/pyfedi/venv/lib/python3.13/site-packages/jinja2/ext.py", line 180, in gettext
 return rv % variables # type: ignore
 ~~~^~~~~~~~~~~
 File "/chiffre1/home/piefed/pyfedi/venv/lib/python3.13/site-packages/markupsafe/__init__.py", line 165, in __mod__
 return self.__class__(super().__mod__(value))
 ~~~~~~~~~~~~~~~^^^^^^^
 File "/chiffre1/home/piefed/pyfedi/venv/lib/python3.13/site-packages/markupsafe/__init__.py", line 367, in __getitem__
 return self.__class__(self.obj[key], self.escape)
 ~~~~~~~~^^^^^
KeyError: 'instance'
## info Piefed : 1.6.19 Steps : - Pin a post to the instance - Then admin user can't access the post menu anymore. (The three dot button at bottom right) Post : https://tarte.nuage-libre.fr/c/meta/p/296841/mise-a-jour-des-rubriques ## Error logs ``` Response Status Error Code 500 from /post/296841/True/options_menu ``` ``` 2026年04月26日 15:54:14,386 ERROR: Exception on /post/296841/True/options_menu [GET] [in /chiffre1/home/piefed/pyfedi/venv/lib/python3.13/site-packages/flask/app.py:875] Traceback (most recent call last): File "/chiffre1/home/piefed/pyfedi/venv/lib/python3.13/site-packages/flask/app.py", line 1511, in wsgi_app response = self.full_dispatch_request() File "/chiffre1/home/piefed/pyfedi/venv/lib/python3.13/site-packages/flask/app.py", line 919, in full_dispatch_request rv = self.handle_user_exception(e) File "/chiffre1/home/piefed/pyfedi/venv/lib/python3.13/site-packages/flask/app.py", line 917, in full_dispatch_request rv = self.dispatch_request() File "/chiffre1/home/piefed/pyfedi/venv/lib/python3.13/site-packages/flask/app.py", line 902, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^ File "/chiffre1/home/piefed/pyfedi/app/utils.py", line 1550, in decorated_function return func(*args, **kwargs) File "/chiffre1/home/piefed/pyfedi/app/post/routes.py", line 946, in post_options return render_template('post/post_options.html', post=post, existing_bookmark=existing_bookmark, hidden=hidden, offer_markdown_source=offer_markdown_source) File "/chiffre1/home/piefed/pyfedi/app/utils.py", line 75, in render_template content = flask.render_template(template_name, **context) File "/chiffre1/home/piefed/pyfedi/venv/lib/python3.13/site-packages/flask/templating.py", line 150, in render_template return _render(app, template, context) File "/chiffre1/home/piefed/pyfedi/venv/lib/python3.13/site-packages/flask/templating.py", line 131, in _render rv = template.render(context) File "/chiffre1/home/piefed/pyfedi/venv/lib/python3.13/site-packages/jinja2/environment.py", line 1295, in render self.environment.handle_exception() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^ File "/chiffre1/home/piefed/pyfedi/venv/lib/python3.13/site-packages/jinja2/environment.py", line 942, in handle_exception raise rewrite_traceback_stack(source=source) File "/chiffre1/home/piefed/pyfedi/app/templates/post/post_options.html", line 76, in top-level template code {{ _('Un-sticky from instance') }} ^ File "/chiffre1/home/piefed/pyfedi/venv/lib/python3.13/site-packages/jinja2/ext.py", line 168, in _gettext_alias return __context.call(__context.resolve("gettext"), *args, **kwargs) ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/chiffre1/home/piefed/pyfedi/venv/lib/python3.13/site-packages/jinja2/ext.py", line 180, in gettext return rv % variables # type: ignore ~~~^~~~~~~~~~~ File "/chiffre1/home/piefed/pyfedi/venv/lib/python3.13/site-packages/markupsafe/__init__.py", line 165, in __mod__ return self.__class__(super().__mod__(value)) ~~~~~~~~~~~~~~~^^^^^^^ File "/chiffre1/home/piefed/pyfedi/venv/lib/python3.13/site-packages/markupsafe/__init__.py", line 367, in __getitem__ return self.__class__(self.obj[key], self.escape) ~~~~~~~~^^^^^ KeyError: 'instance' ```
Collaborator
Copy link

I tied to replicate this on the main branch and I can access the three dot menu just fine, but whenever I try to submit the edit post form, I get a 400 response back, no exception thrown by python.

I tied to replicate this on the main branch and I can access the three dot menu just fine, but whenever I try to submit the edit post form, I get a 400 response back, no exception thrown by python.
Collaborator
Copy link

I just tried to replicate this again tonight and wasn't able to. Editing posts seemed to work just fine. Give this another shot after updating. I am going to close this for now, but feel free to reopen it if this happens again.

I just tried to replicate this again tonight and wasn't able to. Editing posts seemed to work just fine. Give this another shot after updating. I am going to close this for now, but feel free to reopen it if this happens again.
Sign in to join this conversation.
No Branch/Tag specified
main
v1.7.x
v1.6.x
v1.5.x
v1.4.x
v1.2.x
v1.3.x
async-microservice
gevent
schema
v1.1.x
swagger-api
v1.0.x
v0.99
infinite-scroll
refactor-post-new
v1.7.5
v1.7.4
v1.7.3
v1.7.2
v1.7.1
v1.7.0
v1.6.27
v1.6.26
v1.6.25
v1.6.24
v1.6.23
v1.6.22
v1.6.21
v1.6.20
v1.6.19
v1.6.18
v1.6.17
v1.6.16
v1.6.15b
v1.6.15
1.6.14
v1.6.13
v1.6.12
v1.6.11
v1.6.10
v1.6.9
v1.6.8
v1.6.7
v1.6.6
v1.6.5
v1.6.4
v1.6.3
v1.6.2
v1.6.0
v1.5.4
v1.5.3
1.5.2
v1.5.1
v1.5.0
v1.4.6
v1.2.7
v1.4.5
v1.4.4
v1.4.3
v1.4.2
v1.3.10
v1.4.1
v1.4.0
v1.3.9
v1.3.8
v1.3.7
v1.3.6
v.1.3.5
v.1.3.4
v1.3.3
v1.3.2
v1.3.1
v1.3.0
v1.2.6
v1.2.5
v1.2.4
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.1.7
v1.1.6
v1.1.5
v1.1.4
v1.1.3
v1.1.2
v1.1.0
v1.0.0
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rimu/pyfedi#1775
Reference in a new issue
rimu/pyfedi
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?