From 57c9c518fb6139edc89cf52b9d84cf1a7eee319a Mon Sep 17 00:00:00 2001 From: Mikko Nieminen Date: Tue, 9 Jan 2024 10:52:31 +0100 Subject: [PATCH] fix ProjectForm get_owner() call (#880) --- projectroles/forms.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projectroles/forms.py b/projectroles/forms.py index fcbd4ff6..2eb11b4e 100644 --- a/projectroles/forms.py +++ b/projectroles/forms.py @@ -697,8 +697,8 @@ def __init__(self, project=None, current_user=None, *args, **kwargs): def clean(self): """Function for custom form validation and cleanup""" self.instance_owner_as = ( - self.instance.get_owner() if self.instance else None - ) + self.instance.get_owner() if self.instance.pk else None + ) # Must check pk, get_owner() with unsaved model fails in Django v4+ disable_categories = getattr( settings, 'PROJECTROLES_DISABLE_CATEGORIES', False )