Skip to content

review exercise#61

Open
LingfengGO wants to merge 1 commit intoTHUCampus:masterfrom
LingfengGO:dev-alice
Open

review exercise#61
LingfengGO wants to merge 1 commit intoTHUCampus:masterfrom
LingfengGO:dev-alice

Conversation

@LingfengGO
Copy link
Copy Markdown

No description provided.

Comment thread adminpage/views.py
# user = auth.authenticate(username=username,password=password)
# auth.login(self.request, user)
# except:
# raise ValidateError("System error!")
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

注释掉的代码应该删除

Comment thread adminpage/views.py
#获取活动列表
def get(self):
# if self.request.user.is_authenticated():
activity_List = []
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

为什么要把所有检查登陆的操作注释掉。。。。。。这应该是必须的

Comment thread adminpage/views.py
activity.save()
else:
raise ValidateError("Activity is already deleted!")

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

nice code here......我们小组貌似忘了处理 活动不存在和已经被删除的情况。。。

Comment thread userpage/views.py
if (year < 1911 or year > datetime.datetime.now().year):
raise ValidateError('无效学号!')
else:
raise ValidateError('无效学号!')
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

学号验证应该有更好的方式。

Comment thread adminpage/views.py

# #修改活动详情
def post(self):
# if self.request.user.is_authenticated():
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

应该首先判断活动是否结束

Comment thread adminpage/views.py
f.write(index)
f.close()
return SITE_DOMAIN + '/img/activityImage/' + image.name
except:
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

不应该使用图片名作为标识,可能出现重名覆盖导致前面的图片丢失。应该专门生成一个id

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