-
Notifications
You must be signed in to change notification settings - Fork 368
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
update export file access #6112
Conversation
ca9685f
to
3b34e37
Compare
3b34e37
to
94f2520
Compare
94f2520
to
eabb7bc
Compare
438c8ed
to
4ae6321
Compare
9595259
to
d75a2ea
Compare
if not next_page: | ||
next_page = SITE_ROOT | ||
|
||
if not is_pro_version(): |
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.
这部分可以去掉,urls 中已经处理了
if not next_page: | ||
next_page = SITE_ROOT | ||
|
||
if not is_pro_version(): |
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.
这部分可以去掉,urls 中已经处理了
if not next_page: | ||
next_page = SITE_ROOT | ||
|
||
if not is_pro_version(): |
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.
这里可以去掉,urls.py 中已经处理了
|
||
if not check_time_period_valid(start, end): | ||
messages.error(request, _('Failed to export excel, invalid start or end date')) | ||
return HttpResponseRedirect(next_page) |
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.
这样的是不是就不用跳转了,直接返回错误提示
excel_name = 'perm-audit-logs.xlsx' | ||
else: | ||
error_msg = 'log_type invalid' | ||
return api_error(400, error_msg) |
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.
status.HTTP_400_BAD_REQUEST
seahub/api2/endpoints/utils.py
Outdated
token = jwt.encode(payload, SECRET_KEY, algorithm='HS256') | ||
headers = {"Authorization": "Token %s" % token} | ||
url = urljoin(SEAFEVENTS_SERVER_URL, '/add-init-export-log-task') | ||
params = {'tstart': start_timestamp, 'tend': end_timestamp, 'log_type': log_type} |
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.
参数改成start_time, end_time
No description provided.