Skip to content

Commit

Permalink
Fix/close notify (#42)
Browse files Browse the repository at this point in the history
* feat: 在注册校验层,增加group_id字段的存在性判断

* fix: 暂时移除notify接口
  • Loading branch information
colorful3 authored and pedro committed Apr 26, 2019
1 parent d7f9478 commit 218519f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 85 deletions.
2 changes: 0 additions & 2 deletions app/api/cms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ def create_cms():
from .admin import admin_api
from .user import user_api
from .log import log_api
from .notify import notify_api
from .test import test_api
admin_api.register(cms)
user_api.register(cms)
log_api.register(cms)
notify_api.register(cms)
test_api.register(cms)
return cms
82 changes: 0 additions & 82 deletions app/api/cms/notify.py

This file was deleted.

7 changes: 6 additions & 1 deletion app/validators/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
:copyright: © 2019 by the Lin team.
:license: MIT, see LICENSE for more details.
"""

from lin import manager
from wtforms import DateTimeField, PasswordField, FieldList, IntegerField, StringField
from wtforms.validators import DataRequired, Regexp, EqualTo, length, Optional, NumberRange
import time
Expand All @@ -27,6 +27,11 @@ class RegisterForm(Form):
Optional()
])

def validate_group_id(self, value):
exists = manager.group_model.get(id=value.data)
if not exists:
raise ValueError('分组不存在')


# 登陆校验
class LoginForm(Form):
Expand Down

0 comments on commit 218519f

Please sign in to comment.