Open ruomengz opened 7 years ago
project/groups/views.py
line 168 and line 173, querying database twice.Solution: So we decided to use the server times instead of user local time.
project/users/views.py
line 27-41, line 51-74.reader: Yufu Wang recorder: Tianhua Fang component: download
group = db.session.query(Group).filter_by(groupname=groupname).first()
user = db.session.query(User).filter_by(id=session['user_id']).first()
Repeated for 3 times in group class. Reductant work.Solution: Write a function for it so we can call it anytime we need it.
Solution: Do the cache manually. Set no-cache http header after every pages that requires login.
Solution: Write an else statment so it will report the corresponding message.
reader: Yunlei Qiu recorder: Ruomeng Zhang component: add event, user class