Skip to content
Permalink
Browse files

[#15] ID 중복체크 API

  • Loading branch information...
JoMingyu committed Mar 7, 2019
1 parent e47898d commit 75127b187f4ba85c4422a8514a1ef16b16b3340c
@@ -9,3 +9,7 @@ class TblUsers(Base):
id = Column(String(64), primary_key=True)
password = Column(CHAR(93)) # len(werkzeug.security.generate_password_hash())
nickname = Column(String(32))

@classmethod
def is_id_already_signed(cls, session, id):
return cls.get_first_without_none_check(session, cls.id == id) is not None

This file was deleted.

Oops, something went wrong.
File renamed without changes.
@@ -0,0 +1,19 @@
from flask import abort

from app.extensions import main_db
from app.models.user import TblUsers
from app.views.base import BaseResource


class IDDuplicateCheckAPI(BaseResource):
def get(self, id):
"""
ID 중복체크 API
"""

session = main_db.session

if TblUsers.is_id_already_signed(session, id):
abort(409)
else:
return {}, 200

0 comments on commit 75127b1

Please sign in to comment.
You can’t perform that action at this time.