minor fixes qol #6
@ -33,6 +33,9 @@ def register():
|
|||||||
flash("Illegal Character in Username. Please choose a different one one.")
|
flash("Illegal Character in Username. Please choose a different one one.")
|
||||||
elif response == "ERR_NICKNAMEINUSE":
|
elif response == "ERR_NICKNAMEINUSE":
|
||||||
flash("Username already taken. Please choose a different one!")
|
flash("Username already taken. Please choose a different one!")
|
||||||
|
elif response == "CAP_REFUSED":
|
||||||
|
flash("This IRCd doesn't support the draft/account-registration capability")
|
||||||
|
return redirect(webchat_url)
|
||||||
elif response == "SUCCESS":
|
elif response == "SUCCESS":
|
||||||
return redirect(webchat_url)
|
return redirect(webchat_url)
|
||||||
else:
|
else:
|
||||||
|
1
forms.py
1
forms.py
@ -4,6 +4,7 @@ from wtforms.validators import DataRequired, Length, EqualTo
|
|||||||
|
|
||||||
|
|
||||||
class RegistrationForm(FlaskForm):
|
class RegistrationForm(FlaskForm):
|
||||||
|
# clarify that it conforms with casemapping on ircd.
|
||||||
username = StringField('Username', validators=[DataRequired(), Length(min=1, max=32)])
|
username = StringField('Username', validators=[DataRequired(), Length(min=1, max=32)])
|
||||||
password = PasswordField('Password', validators=[DataRequired()])
|
password = PasswordField('Password', validators=[DataRequired()])
|
||||||
confirm_password = PasswordField('Confirm Password', validators=[DataRequired(), EqualTo('password')])
|
confirm_password = PasswordField('Confirm Password', validators=[DataRequired(), EqualTo('password')])
|
||||||
|
@ -59,7 +59,7 @@ def ircregister(userip, username, password, email="*"):
|
|||||||
return "ERR_NICKNAMEINUSE"
|
return "ERR_NICKNAMEINUSE"
|
||||||
_send(irctokens.build("CAP", ["REQ", "draft/account-registration"]))
|
_send(irctokens.build("CAP", ["REQ", "draft/account-registration"]))
|
||||||
if line.command == "CAP" and ("NAK" in line.params):
|
if line.command == "CAP" and ("NAK" in line.params):
|
||||||
return "cap refused"
|
return "CAP_REFUSED"
|
||||||
elif line.command == "CAP" and ("ACK" in line.params):
|
elif line.command == "CAP" and ("ACK" in line.params):
|
||||||
to_send = irctokens.build("CAP", ["END"])
|
to_send = irctokens.build("CAP", ["END"])
|
||||||
_send(to_send)
|
_send(to_send)
|
||||||
|
Loading…
Reference in New Issue
Block a user