TypeError: Cannot create a consistent method resolution in django

In Python, every class inherits from a built-in basic class called object.

Your OwnerCourseMixin is inheriting from object and some other class. Because the other class(es), in this case, LoginRequiredMixin and PermissionRequiredMixin, already inherit from object, Python now cannot determine what class to look methods up on first.

You don’t need to inherit from object here.

class OwnerCourseMixin(LoginRequiredMixin, PermissionRequiredMixin):
    model = Course
    fields = ['subject', 'title', 'slug', 'overview']
    success_url = reverse_lazy('manage_course_list')

That should work.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top