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

update export file access #6112

Merged
merged 12 commits into from
Jul 10, 2024
Merged

update export file access #6112

merged 12 commits into from
Jul 10, 2024

Conversation

awu0403
Copy link
Contributor

@awu0403 awu0403 commented May 24, 2024

No description provided.

if not next_page:
next_page = SITE_ROOT

if not is_pro_version():
Copy link
Contributor

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():
Copy link
Contributor

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():
Copy link
Contributor

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)
Copy link
Contributor

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)
Copy link
Contributor

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

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}
Copy link
Contributor

Choose a reason for hiding this comment

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

参数改成start_time, end_time

@freeplant freeplant merged commit a27f6d3 into 12.0 Jul 10, 2024
1 check passed
@freeplant freeplant deleted the async-export-excel branch July 10, 2024 06:38
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.

4 participants