-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve cloned forms naming #4114
Conversation
hypha/apply/funds/utils.py
Outdated
@@ -159,3 +162,29 @@ def is_filter_empty(filter: filters.FilterSet) -> bool: | |||
|
|||
# Flatten the QueryDict values in filter.data to a single list, check for validity with any() | |||
return any(reduce(iconcat, [param[1] for param in query.lists()], [])) | |||
|
|||
|
|||
def get_copied_form_name(orignal_form_name: str) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can i suggest adding some quick unit test for this util. esp. the regex pattens I don't trust them too much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes totally!
@theskumar unit tests added in the last commit - was trying to find a way to patch/mock |
Fixes #3546 Improves the naming of cloned forms by changing the format to `<original form name> (Copied on <%Y-%m-%d %H:%M:%S.%f>)`, ie. cloning `Test Form` would result in a duplicated form with the name `Test Form (Copied on 2024-08-27 17:34:32.004)`. If a form name with a timestamp already exists on a form it will be subbed via RegEx matching.
Fixes #3546. Improves the naming of cloned forms by changing the format to
<original form name> (Copied on <%Y-%m-%d %H:%M:%S.%f>)
, ie. cloningTest Form
would result in a duplicated form with the nameTest Form (Copied on 2024-08-27 17:34:32.004)
. If a form name with a timestamp already exists on a form it will be subbed via RegEx matching.Test Steps
(Copied on <%Y-%m-%d %H:%M:%S.%f>)
appended to it