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

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

Closed
2 tasks
FreemanPancake opened this issue Aug 5, 2024 · 12 comments
Closed
2 tasks

Comments

@FreemanPancake
Copy link
Contributor

FreemanPancake commented Aug 5, 2024

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 4. Then go to admin panel, create new page content. 5. 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?

  • Yes, I want to help fix this issue and I will join #workgroup-pr-review on Slack to confirm with the community that a PR is welcome.
  • No, I only want to report the issue.
@fsbraun
Copy link
Member

fsbraun commented Aug 5, 2024

@FreemanPancake Can you share the traceback?

@FreemanPancake
Copy link
Contributor Author

@fsbraun please reference this:
image

@fsbraun
Copy link
Member

fsbraun commented Aug 6, 2024

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

@fsbraun
Copy link
Member

fsbraun commented Aug 8, 2024

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

@joshyu
Copy link
Contributor

joshyu commented Aug 27, 2024

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
Copy link
Contributor

joshyu commented Aug 27, 2024

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
Copy link
Member

fsbraun commented Aug 27, 2024

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

  • Add a position = models.PositiveIntegerField(...) field to Workflow which then needs to be the primary ordering field, or,
  • remove SortableAdminMixin form WorkflowAdmin

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

@fsbraun
Copy link
Member

fsbraun commented Aug 27, 2024

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
Copy link
Contributor

joshyu commented Aug 28, 2024

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

@FreemanPancake
Copy link
Contributor Author

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
Copy link
Member

fsbraun commented Aug 28, 2024

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

@fsbraun
Copy link
Member

fsbraun commented Aug 28, 2024

fixed by #279

@fsbraun fsbraun closed this as completed Aug 28, 2024
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

3 participants