digitalfabrik / integreat-cms

Simplified content management back end for the Integreat App - a multilingual information platform for newcomers
https://digitalfabrik.github.io/integreat-cms/
Apache License 2.0
55 stars 33 forks source link

Error when creating a new page #2872

Closed charludo closed 1 month ago

charludo commented 1 month ago

Describe the Bug

When creating a new page, django throws an error ValueError: 'Page' instance needs to have a primary key value before this relationship can be used. This is not critical, as page creation is still possible. Rather, this is a bug within the get_repr method of the Page model, where self.best_translation is accessed before that relation exists.

Steps to Reproduce

  1. Visit http://localhost:8000/augsburg/pages/de/new/
  2. See error in django console

Expected Behavior

No error

Actual Behavior

Error, but does not prevent page creation

Additional Information

Traceback ``` ```
JoeyStk commented 1 month ago

@charludo is this a duplicate of https://github.com/digitalfabrik/integreat-cms/issues/2806 or is it something different? :thinking:

charludo commented 1 month ago

@charludo is this a duplicate of #2806 or is it something different? 🤔

Oops, sorry about that - did not see this!