Browse Source

id允许大写字母(兼容老用户)

master
欧醚 3 years ago
parent
commit
b7c8bdc1f6
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      ask.py
  2. +1
    -1
      static/ask.html

+ 1
- 1
ask.py View File

@ -77,7 +77,7 @@ def root():
@limiter.limit("10 / minute")
def set_inbox():
acct = request.form.get('username')
if not re.match('[a-z0-9_]{1,30}(@[a-z\.-_]+)?', acct):
if not re.match('[A-Za-z0-9_]{1,30}(@[a-z\.-_]+)?', acct):
return '无效的闭社id', 422
r = th.conversations()

+ 1
- 1
static/ask.html View File

@ -72,7 +72,7 @@
<div class="input-group-prepend">
<div class="input-group-text">@</div>
</div>
<input type="text" class="form-control" id="username" placeholder="用户名" required="required" pattern="[a-z0-9_]{1,30}(@[a-z\.-_]+)?">
<input type="text" class="form-control" id="username" placeholder="用户名" required="required" pattern="[A-Za-z0-9_]{1,30}(@[a-z\.-_]+)?">
</div>
<button id="send" type="submit" class="btn btn-primary mb-2">我已私信</button>
</form>

Loading…
Cancel
Save