mirror of
https://github.com/modoboa/modoboa.git
synced 2026-04-26 01:16:01 +03:00
[PR #1432] [MERGED] fix import command #2227
Labels
No labels
bug
bug
dependencies
design
documentation
duplicate
enhancement
enhancement
enhancement
feedback-needed
help-needed
help-needed
installer
invalid
looking-for-sponsors
modoboa-contacts
new-ui
new-ui
pr
pull-request
pyconfr
python
question
security
stale
webmail
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/modoboa-modoboa#2227
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/modoboa/modoboa/pull/1432
Author: @ghost
Created: 3/11/2018
Status: ✅ Merged
Merged: 4/6/2018
Merged by: @tonioo
Base:
master← Head:fix/1430📝 Commits (4)
3bd365efix import commanddab91ebonly use backports.csv on python 2e9c1b53when importing use chardet if utf-8 fails26fad9bMerge branch 'master' into fix/1430📊 Changes
8 files changed (+140 additions, -13 deletions)
View changed files
📝
modoboa/admin/management/commands/subcommands/_export.py(+6 -2)📝
modoboa/admin/management/commands/subcommands/_import.py(+53 -8)➕
modoboa/admin/tests/test_data/import_domains.csv(+2 -0)➕
modoboa/admin/tests/test_data/import_domains_duplicates.csv(+3 -0)📝
modoboa/admin/tests/test_import_.py(+64 -0)📝
modoboa/admin/views/export.py(+5 -1)📝
modoboa/admin/views/import_.py(+6 -1)📝
requirements.txt(+1 -1)📄 Description
I can't replicate the issue in #1430, but here's a couple of changes that might fix it.
ensure command line args are unicode(py2)/str(py3)
use io.open to open file with utf8 encoding
set newlines="" in open commands, csv module takes care of line endings
add tests for import command
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.