mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-18 19:32:24 -06:00
Closes #15465: Clean up settings.py
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
__all__ = (
|
||||
'title',
|
||||
'trailing_slash',
|
||||
)
|
||||
|
||||
|
||||
@@ -8,3 +9,10 @@ def title(value):
|
||||
Improved implementation of str.title(); retains all existing uppercase letters.
|
||||
"""
|
||||
return ' '.join([w[0].upper() + w[1:] for w in str(value).split()])
|
||||
|
||||
|
||||
def trailing_slash(value):
|
||||
"""
|
||||
Remove a leading slash (if any) and include a trailing slash, except for empty strings.
|
||||
"""
|
||||
return f'{value.strip("/")}/' if value else ''
|
||||
|
||||
Reference in New Issue
Block a user