django-cast icon indicating copy to clipboard operation
django-cast copied to clipboard

Page has no page_ptr During Preview

Open ephes opened this issue 1 year ago • 1 comments

From sentry:

            self.related_val = self.source_field.get_foreign_related_value(instance)
            if None in self.related_val:
                raise ValueError(
                    '"%r" needs to have a value for field "%s" before '
                    "this many-to-many relationship can be used."
                    % (instance, self.pk_field_names[self.source_field_name])
                )
            # Even if this relation is not to pk, we require still pk value.

ephes avatar May 07 '24 10:05 ephes

Hmm, it's not easy to fix. Maybe wait for some Wagtail minor versions fixing this?

ephes avatar May 07 '24 15:05 ephes

Ok, it is still broken.. maybe just catch and ignore it?

ephes avatar Jun 26 '24 16:06 ephes

Still broken:

"<Post: Weeknotes 2024-07-08>" needs to have a value for field "page_ptr" before this many-to-many relationship can be used.
        except ValueError:
            # will be raised on wagtail preview because page_ptr is not set
            pass
        return super().serve_preview(request, mode_name)

ephes avatar Jul 01 '24 14:07 ephes