Skip to content

Commit 30b5e0b

Browse files
committed
Removed error logs
1 parent a3ab393 commit 30b5e0b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

backend/PyMatcha/models/user.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def create(
8989
except ValueError:
9090
pass
9191
else:
92-
logging.error("Email {} taken".format(email))
92+
logging.warning("Email {} taken".format(email))
9393
raise ConflictError("Email {} taken.".format(email), "Use another email.")
9494

9595
# Check username availability
@@ -98,17 +98,17 @@ def create(
9898
except ValueError:
9999
pass
100100
else:
101-
logging.error("Username {} taken".format(username))
101+
logging.warning("Username {} taken".format(username))
102102
raise ConflictError("Username {} taken.".format(username), "Try another username.")
103103

104104
# Check correct gender
105105
if gender not in ["male", "female", "other"]:
106-
logging.error("Gender must be male, female or other, not {}".format(gender))
106+
logging.warning("Gender must be male, female or other, not {}".format(gender))
107107
raise ConflictError("Gender must be male, female or other, not {}.".format(gender))
108108

109109
# Check correct orientation
110110
if orientation not in ["heterosexual", "homosexual", "bisexual", "other"]:
111-
logging.error(
111+
logging.warning(
112112
"Sexual Orientation must be heterosexual, homosexual, bisexual or other, not {}.".format(orientation)
113113
)
114114
raise ConflictError(
@@ -119,7 +119,7 @@ def create(
119119
try:
120120
Geohash.decode(geohash)
121121
except ValueError as e:
122-
logging.error("Geohash error: {}".format(e))
122+
logging.warning("Geohash error: {}".format(e))
123123
raise e
124124

125125
# Encrypt password
@@ -166,7 +166,7 @@ def register(email: str, username: str, password: str, first_name: str, last_nam
166166
except ValueError:
167167
pass
168168
else:
169-
logging.error("Username {} taken".format(username))
169+
logging.warning("Username {} taken".format(username))
170170
raise ConflictError("Username {} taken.".format(username), "Try another username.")
171171

172172
# Encrypt password

backend/PyMatcha/utils/confirm_token.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
def generate_confirmation_token(email, token_type):
3030
logging.debug("Generating confirmation token for email {}".format(email))
3131
if token_type not in ACCEPTED_TOKEN_TYPES:
32-
logging.error("token_type must be of {} and is {}".format(ACCEPTED_TOKEN_TYPES, token_type))
32+
logging.warning("token_type must be of {} and is {}".format(ACCEPTED_TOKEN_TYPES, token_type))
3333
raise ValueError("Reset token type must be confirm or reset.")
3434
serializer = URLSafeTimedSerializer(application.config["FLASK_SECRET_KEY"])
3535
token = serializer.dumps(email + ":{}".format(token_type), salt=application.config["FLASK_SECRET_KEY"])

0 commit comments

Comments
 (0)