def save(self, *args, **kwargs): if self.pk is None: self.key = hashing.get_hash(self.expired_at, self.email, self.prefix_url) # We do not allow users have different workspaces upper/lower cases. # So let's do it uppercase. self.prefix_url = self.prefix_url.upper() super().save(*args, **kwargs)
def test_key(self): self.assertEqual( self.invitation_request.key, hashing.get_hash( self.invitation_request.expired_at, self.invitation_request.email, self.invitation_request.workspace.prefix_url ) )
def test_key(self): self.assertEqual( self.registration_request.key, hashing.get_hash( self.registration_request.expired_at, self.registration_request.email, self.registration_request.prefix_url ) )
def save(self, *args, **kwargs): if self.pk is None: self.key = hashing.get_hash(self.expired_at, self.email, self.workspace.prefix_url) super().save(*args, **kwargs)
def save(self, *args, **kwargs): if self.pk is None: self.key = hashing.get_hash(self.expired_at, self.email) super().save(*args, **kwargs)
def test_key(self): self.assertEqual( hashing.get_hash(self.forgot_request.expired_at, self.forgot_request.email), self.forgot_request.key )