Open levigross opened 9 years ago
This section of the EncryptedMixin
if not self.max_length: self.max_length = 10 self.unencrypted_max_length = self.max_length self.max_length = calc_encrypted_length(self.unencrypted_max_length)
Can be written better
self.unencrypted_max_length = self.max_length or 10 self.max_length = calc_encrypted_length(self.unencrypted_max_length)
This saves you the if statement and reassignment.
Really, since unencrypted_max_length isn't used anywhere else, the whole thing could be:
self.max_length = calc_encrypted_length(self.max_length or 10)
This section of the EncryptedMixin
Can be written better
This saves you the if statement and reassignment.