Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

2016013243 #56

wants to merge 1 commit into from

Conversation

tzw28
Copy link

@tzw28 tzw28 commented Nov 16, 2018

No description provided.

@tzw28 tzw28 changed the title Tai_WeChatTicket 2016013243 Nov 16, 2018
auth.logout(self.request)
except:
raise ValidateError("Fail to logout!")

Copy link
Author

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!")

Copy link
Author

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!')

Copy link
Author

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('无效学号!')

Copy link
Author

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,
})

Copy link
Author

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('对不起,当前没有已经购买的有效票')

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

代码重复程度高

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant