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
feat: Translations Downloads as zip #5624
feat: Translations Downloads as zip #5624
Conversation
0c13933
to
9da0b2f
Compare
Codecov Report
@@ Coverage Diff @@
## development #5624 +/- ##
===============================================
- Coverage 64.31% 64.28% -0.04%
===============================================
Files 273 274 +1
Lines 13178 13203 +25
===============================================
+ Hits 8476 8488 +12
- Misses 4702 4715 +13
Continue to review full report at Codecov.
|
9da0b2f
to
acabbd0
Compare
acabbd0
to
9e25757
Compare
e709baf
to
4bce795
Compare
@iamareebjamal Can you please review this? |
I've kept |
Ignore codacy |
app/api/admin_translations.py
Outdated
def remove_file(response): | ||
os.remove(os.path.join(app_dir, 'translations.zip')) | ||
return response | ||
return send_file('translations.zip', mimetype='application/zip', |
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.
Move this line to correct place
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.
@after_this_request
is getting skipped if I move the line upwards. You were referring to move the return send_file('translations.zip', mimetype='application/zip', as_attachment=True, attachment_filename='translations.zip')
,above @after_this_request
, right? Did I get you wrong ?
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.
Yes I was referring to that
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.
Alright, will do it.
4bce795
to
4ca9900
Compare
You simply write "Error while deleting translations zip file " |
cdee44e
to
5e83dfc
Compare
5e83dfc
to
7193460
Compare
7193460
to
b29a47a
Compare
Blueprint registration
@iamareebjamal Here is the updated PR |
@@ -13,8 +13,9 @@ def download_translations(): | |||
"""Admin Translations Downloads""" | |||
uuid_literal = uuid.uuid4() | |||
zip_file = "translations{}".format(uuid_literal) | |||
zip_file_ext = zip_file+'.zip' | |||
shutil.make_archive(zip_file, "zip", translations_dir) |
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.
Pass zip_file_ext
in this function
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.
Done. Sending a PR right now.
d7c6589
to
c23bcfd
Compare
extracted and replaced filenames
@CosmicCoder96 Please review. |
Fixes #5619
Checklist
development
branch.Short description of what this resolves:
Changes proposed in this pull request: