v0.6.1: remove duplicate is_valid_email from app.py (re now lives in helpers)
This commit is contained in:
parent
0a01381d44
commit
0e50908747
3 changed files with 2 additions and 11 deletions
9
app.py
9
app.py
|
|
@ -494,15 +494,6 @@ def admin_login():
|
|||
return render_template('admin/login.html')
|
||||
|
||||
|
||||
def is_valid_email(email):
|
||||
"""Return True if the given string looks like a valid email address."""
|
||||
if not email:
|
||||
return False
|
||||
# Very loose regex: local@domain.tld, no spaces, with a real TLD part.
|
||||
pattern = r"^[^\s@]+@[^\s@]+\.[^\s@]+$"
|
||||
return re.match(pattern, email) is not None
|
||||
|
||||
|
||||
@app.route('/admin/logout')
|
||||
def admin_logout():
|
||||
"""Clear the admin session."""
|
||||
|
|
|
|||
Reference in a new issue