Skip to content

Commit

Permalink
Remove unneeded function is_year
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkohei13 committed Jul 23, 2024
1 parent 0b8e212 commit 3833060
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
2 changes: 0 additions & 2 deletions app/controllers/admin_challenge.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ def validate_challenge_data(form_data):
if len(form_data["autocomplete"]) > 250:
errors += "autocomplete on liian pitkä, maksimi 250 merkkiä. "

# Todo: Remove is_year helper function, when no longer needed

# Begin and end date
if not form_data["date_begin"]:
errors += "Alkupäivä puuttuu. "
Expand Down
15 changes: 0 additions & 15 deletions app/helpers/common_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,21 +146,6 @@ def is_yyyy_mm_dd(input_string):
return bool(pattern.match(input_string))


def is_year(input_string):
"""
Validates if a given string is a valid year in YYYY format.
Args:
input_string (str): The string to validate.
Returns:
bool: True if the input_string is a valid year in YYYY format,
False otherwise.
"""
pattern = re.compile(r'^\d{4}$')
return bool(pattern.match(input_string))


def valid_taxon_qname(input_string):
"""
Validates if a given string is a valid taxon QName.
Expand Down

0 comments on commit 3833060

Please sign in to comment.