Cleaner logic

This commit is contained in:
Brian Tiemann 2024-12-17 21:12:48 -05:00
parent bf82101e84
commit 6a4c944e64

View File

@ -87,9 +87,8 @@ class CachedScopeMixin(models.Model):
abstract = True abstract = True
def clean(self): def clean(self):
if self.scope_type: if self.scope_type and not self.scope:
scope_type = self.scope_type.model_class() scope_type = self.scope_type.model_class()
if not self.scope:
raise ValidationError({ raise ValidationError({
'scope': _( 'scope': _(
"Please select a {scope_type}." "Please select a {scope_type}."