fsbraun / djangocms-blog

django CMS blog application - Support for multilingual posts, placeholders, social network meta tags and configurable apphooks
https://djangocms-blog.readthedocs.io
BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

Save a post fails without error message #7

Closed MacLake closed 2 weeks ago

MacLake commented 1 month ago

Description

We are experiencing a strange issue with djangocms-blog (Fabians fork for django cms 4.1): When a user who is not admin tries to save new post, the runserver log (in case of a test on the developing machine) shows a 200 OK in the log, but the new post dialogue stays open and the article is actually not saved. There’s no error message.

[25/Oct/2024 15:41:03] "POST /de/admin/djangocms_blog/post/add/?language=de&_changelist_filters=language%3Dde HTTP/1.1" 200 112391
[25/Oct/2024 15:41:03] "GET /de/admin/jsi18n/ HTTP/1.1" 200 8351

If on the other hand the user is admin, the post is being saved, so it seems to be a privilege problem. But all blog related privileges have been activated for the editors group, it seems there was one new blog after the update to cms 4.1, and normal pages can be created and edited by a user in the editor group who is not admin.

Steps to reproduce

I’m not sure if it can be reproduced, but what we do:

  1. Create an editors groups with all permissions of the blog app and all other necessary permissions for creating articles.
  2. Open the menu item “Create Article…” and fill out at least the Title
  3. Click on the “Save” button

Versions

Python 3.11 Django 5.1.2 django-cms==4.1.3 djangocms-versioning==2.0.2 djangocms-blog @ git+https://github.com/fsbraun/djangocms-blog.git@4efe3ba11ca9f6ff8943a8482359a9e2b2a17288

Expected behaviour

Dialogue should close, article should be saved, and become visible in the list of articles, in admin and in the front end.

Actual behaviour

Dialogue stays open, article apparently isn’t saved, at least it doesn’t show up, neither in the list in the admin section or in the front end. In the log the POST request is being listed with a 200 OK response, though, no error message is shown.

Additional information

On 1st of October a colleague has successfully saved an article with the same djangocms-blog version. So I’m not sure if the issue is really caused by the blog app, maybe something else triggers it.

Users with admin privileges can save blog articles without problem.

MacLake commented 2 weeks ago

I have successfully reproduced this issue with a fresh install of a forked djangocms-quickstart.

  1. Clone https://github.com/MacLake/django-cms-quickstart/tree/custom
  2. Create superuser as usual
  3. Create a blog app hook page
  4. Create an editors group and editor user (staff, but not superuser) who is in this group (or just the user) and give all available privileges to the group (or user)
  5. Log in as editor and try to create a blog post. Blog –> New article Add at least a title and click on “Save”. The dialogue stays open, the blog post is not saved..
fsbraun commented 2 weeks ago

Fixed in https://github.com/fsbraun/djangocms-blog/commit/bbf503be639419a2a2013fa124d7e507e8d23251