Skip to content

Commit

Permalink
Fixed #35246 -- Made Field.unique a cached property.
Browse files Browse the repository at this point in the history
Co-authored-by: Natalia <[email protected]>
  • Loading branch information
adamchainz and nessita authored Feb 26, 2024
1 parent 73d5eb8 commit e65deb7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion django/db/models/fields/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ def get_db_converters(self, connection):
return [self.from_db_value]
return []

@property
@cached_property
def unique(self):
return self._unique or self.primary_key

Expand Down

0 comments on commit e65deb7

Please sign in to comment.