django-cms / djangocms-moderation

Other
13 stars 21 forks source link

[BUG] Create workflow encounter error, with djangocms-quickstart project #277

Closed FreemanPancake closed 2 weeks ago

FreemanPancake commented 1 month ago

Description

I try to install djangocms-moderation into django-cms-quickstart project: https://github.com/django-cms/django-cms-quickstart to test out the versioning management and workflow. but below error popped up when create new workflow:

image

Steps to reproduce

  1. follow the steps on django-cms-quickstart homepage to setup the project
  2. modify the requirement.in and requirement.txt file and settings file to install and include the djangocms-moderation package image image image image
  3. Then go to admin panel, create new page content.
  4. go through the workflow creation process to create new workflow then you will find out the error

Expected behaviour

Workflow creates normally

Actual behaviour

encounter error

Screenshots

Additional information (CMS/Python/Django versions)

Django 4.2 Python 3.11 Django-CMS 4.1.2

Do you want to help fix this issue?

fsbraun commented 1 month ago

@FreemanPancake Can you share the traceback?

FreemanPancake commented 1 month ago

@fsbraun please reference this:

image
fsbraun commented 1 month ago

Thanks, that's already helpful. Can you let me know the local variables of line 259 in admin.py (the first highlighted row)?

fsbraun commented 1 month ago

@FreemanPancake Can you check if the error goes away with django-admin-sortable2==2.2.2?

joshyu commented 2 weeks ago

Hi @fsbraun ,

After installing the fix you mentioned above, the error disappeared, but we got another error as below. I am also checking how to fix it, and wait for your input.

image

joshyu commented 2 weeks ago

Hi @fsbraun , I have a question about below line, in Workflow model, the default_order field is name, which is a charfield. If we specify the output_field as Integer, I think it might be a mismatch.

image

fsbraun commented 2 weeks ago

@joshyu I think your analysis is correct: If you want a sortable admin, you need an integer-type field for sorting. This means either:

Or, I might need to look deeper, since django-admin-sortable2 throws an assertion error, if I remove SortableAdminMixin.

fsbraun commented 2 weeks ago

Hey, it turns out, I did use SortableAdminMixin instead of SortableAdminBase when adjusting for the latest version of django-sortable-admin. @joshyu Can you check with the above fix?

joshyu commented 2 weeks ago

@fsbraun , Sorry I was blocked with another high priority requirement. I will ask @FreemanPancake to check it and feedback to you later.

FreemanPancake commented 2 weeks ago

Hi @joshyu and @fsbraun , I have installed this fix version on django-cms-quickstart project, and it worked. Thank you all for the outcome.

fsbraun commented 2 weeks ago

@FreemanPancake That's great news! I think we're approaching a level of stability where we can publish moderation on pypi.

fsbraun commented 2 weeks ago

fixed by #279