fix(generate_hash): Deprecate txt parameter - its not used.
`length` has a default value anyway, no need of checking and setting a default. Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
parent
1847e9cae8
commit
07f93e2817
1 changed files with 4 additions and 2 deletions
|
|
@ -1187,8 +1187,10 @@ def generate_hash(txt: str | None = None, length: int = 56) -> str:
|
|||
import math
|
||||
import secrets
|
||||
|
||||
if not length:
|
||||
length = 56
|
||||
if txt:
|
||||
from frappe.utils.deprecations import deprecation_warning
|
||||
|
||||
deprecation_warning("The `txt` parameter is deprecated and will be removed in a future release.")
|
||||
|
||||
return secrets.token_hex(math.ceil(length / 2))[:length]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue