Skip to content

Error with rules on CreateView introduced in 1.4 #85

@dyve

Description

@dyve

https://github.com/dfunckt/django-rules/blob/master/rules/contrib/views.py#L37

Using self.get_object will introduce an error when using rules on a view that inherits from CreateView. This is because CreateView does inherit SingleObjectMixin and does have a get_object callable, but it will throw an exception when its get_object is called:

AttributeError: Generic detail view {InheritsFromCreateView} must be called with either an object pk or a slug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions