Skip to content

Commit 6376a71

Browse files
committed
fix comparison in EnsureUserOwnsProposalMixin after Django introduced lazy user objects: <class 'django.contrib.auth.models.User'> is not <class 'django.utils.functional.SimpleLazyObject'>
1 parent 6d51162 commit 6376a71

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/program/mixins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def dispatch(self, request, *args, **kwargs):
5959
class EnsureUserOwnsProposalMixin(SingleObjectMixin):
6060
def dispatch(self, request, *args, **kwargs):
6161
# make sure that this proposal belongs to the logged in user
62-
if self.get_object().user is request.user:
62+
if self.get_object().user.pk == request.user.pk:
6363
return super().dispatch(request, *args, **kwargs)
6464

6565
messages.error(request, "No thanks")

0 commit comments

Comments
 (0)