Open
Conversation
LingfengGO
commented
Nov 16, 2018
| # user = auth.authenticate(username=username,password=password) | ||
| # auth.login(self.request, user) | ||
| # except: | ||
| # raise ValidateError("System error!") |
| #获取活动列表 | ||
| def get(self): | ||
| # if self.request.user.is_authenticated(): | ||
| activity_List = [] |
Author
There was a problem hiding this comment.
为什么要把所有检查登陆的操作注释掉。。。。。。这应该是必须的
| activity.save() | ||
| else: | ||
| raise ValidateError("Activity is already deleted!") | ||
|
|
Author
There was a problem hiding this comment.
nice code here......我们小组貌似忘了处理 活动不存在和已经被删除的情况。。。
| if (year < 1911 or year > datetime.datetime.now().year): | ||
| raise ValidateError('无效学号!') | ||
| else: | ||
| raise ValidateError('无效学号!') |
|
|
||
| # #修改活动详情 | ||
| def post(self): | ||
| # if self.request.user.is_authenticated(): |
| f.write(index) | ||
| f.close() | ||
| return SITE_DOMAIN + '/img/activityImage/' + image.name | ||
| except: |
Author
There was a problem hiding this comment.
不应该使用图片名作为标识,可能出现重名覆盖导致前面的图片丢失。应该专门生成一个id
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.