Skip to content

Commit

Permalink
Fix style for db_access.py
Browse files Browse the repository at this point in the history
  • Loading branch information
caseyavila committed Nov 15, 2023
1 parent 22b5286 commit f67f54d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Backend/db_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@
# MongoDB connection
connect(db="dbPicturePerfect", host="localhost", port=27017)


class User(Document):
username = StringField(required=True, unique=True)
email = StringField(required=True)
encrypted_password = StringField(
required=True
)
)
ranking = IntField()

meta = {"collection": "users"}
Expand All @@ -41,7 +42,6 @@ class Image(Document):
@app.route("/create_user", methods=["POST"])
def create_user():
data = json.loads(request.data.decode("utf-8"))
#print(f"data = {data}")
user = User(
username=data["username"],
encrypted_password=data["password"],
Expand All @@ -60,7 +60,8 @@ def create_user():
)
except NotUniqueError:
return (
jsonify({"error": "Username or email already exists. Choose another."}),
jsonify({"error": """Username or email already exists.
Choose another."""}),
400,
)

Expand Down

0 comments on commit f67f54d

Please sign in to comment.