-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2016013243 #56
base: master
Are you sure you want to change the base?
2016013243 #56
Conversation
auth.logout(self.request) | ||
except: | ||
raise ValidateError("Fail to logout!") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logout() doesn’t throw any errors if the user wasn’t logged in.
activity.save() | ||
else: | ||
raise ValidateError("Activity is already deleted!") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不应该使用ValidateError()来抛出这个错误
ValidateError('Ticket is invalid') | ||
except: | ||
ValidateError('Fail to Checkin!') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
使用票码和学生证认证这两种情况,分成两个成员函数看起来好一点。
if (year < 1911 or year > datetime.datetime.now().year): | ||
raise ValidateError('无效学号!') | ||
else: | ||
raise ValidateError('无效学号!') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个学号正则验证意义不算大
'Url':ticket, | ||
'PicUrl':activity.pic_url, | ||
}) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
代码重复程度高。点击按钮和文本指令只有输入部分有区别,不建议完全分开。
'PicUrl':ticket.activity.pic_url, | ||
}) | ||
return self.reply_text('对不起,当前没有已经购买的有效票') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
代码重复程度高
No description provided.