-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enhance: WI-154 show field labels not keys (#483)
* enhance: WI-154 do not show recaptcha data * enhance: WI-154 use field labels not keys * test: tour email add labels⚠️ NOT WORKING * fix: WI-154 ignore `form_id` * fix: WI-154 title case properly * fix: WI-154 title case fix has typo * fix: WI-154 restore form id but title cased well * refactor: (minor change) to reduce diff * Revert "refactor: (minor change) to reduce diff" This reverts commit e375b3a. --------- Co-authored-by: Jake Rosenberg <[email protected]>
- Loading branch information
1 parent
5446e52
commit 14c4106
Showing
2 changed files
with
27 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
"""Utilities for Portal | ||
""" | ||
|
||
def reverse_slugify(slug): | ||
""" | ||
:param str slug: A name that is lowercase and uses hyphens instead of spaces | ||
:rtype: str | ||
..note:: Usage: | ||
``` | ||
slug = "and-hello-world-this-is-a-slug" | ||
original_text = reverse_slugify(slug) | ||
print(original_text) # Output: "And Hello World This is a Slug" | ||
``` | ||
""" | ||
|
||
words_to_exclude = {'a', 'is', 'to', 'of', 'for', 'and', 'or', 'in'} | ||
words = slug.split('-') | ||
words_for_title = [ word if word.lower() in words_to_exclude else word.capitalize() for word in words ] | ||
text = ' '.join(words_for_title) | ||
|
||
return text |