mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 17:26:36 -04:00
Merge 63e0ddce72
into 04a0b10a15
This commit is contained in:
commit
e93b66c990
2 changed files with 25 additions and 10 deletions
|
@ -26,7 +26,7 @@ GitHub's online interface.
|
||||||
For users who previously confirmed the license of their contributions on the
|
For users who previously confirmed the license of their contributions on the
|
||||||
support site, it would be great if you could add your name below as well.
|
support site, it would be great if you could add your name below as well.
|
||||||
|
|
||||||
********************
|
---
|
||||||
|
|
||||||
AMBOSS MD Inc. <https://www.amboss.com/>
|
AMBOSS MD Inc. <https://www.amboss.com/>
|
||||||
Aristotelis P. <https://glutanimate.com/contact>
|
Aristotelis P. <https://glutanimate.com/contact>
|
||||||
|
@ -243,8 +243,9 @@ Lee Doughty <32392044+leedoughty@users.noreply.github.com>
|
||||||
memchr <memchr@proton.me>
|
memchr <memchr@proton.me>
|
||||||
Max Romanowski <maxr777@proton.me>
|
Max Romanowski <maxr777@proton.me>
|
||||||
Aldlss <ayaldlss@gmail.com>
|
Aldlss <ayaldlss@gmail.com>
|
||||||
|
josse <112946011+josod827@users.noreply.github.com>
|
||||||
|
|
||||||
********************
|
---
|
||||||
|
|
||||||
The text of the 3 clause BSD license follows:
|
The text of the 3 clause BSD license follows:
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@ import aqt.operations
|
||||||
from anki import hooks
|
from anki import hooks
|
||||||
from anki.collection import OpChanges, OpChangesOnly, Progress, SearchNode
|
from anki.collection import OpChanges, OpChangesOnly, Progress, SearchNode
|
||||||
from anki.decks import UpdateDeckConfigs
|
from anki.decks import UpdateDeckConfigs
|
||||||
|
from anki.errors import BackendError
|
||||||
from anki.scheduler.v3 import SchedulingStatesWithContext, SetSchedulingStatesRequest
|
from anki.scheduler.v3 import SchedulingStatesWithContext, SetSchedulingStatesRequest
|
||||||
from anki.utils import dev_mode
|
from anki.utils import dev_mode
|
||||||
from aqt.changenotetype import ChangeNotetypeDialog
|
from aqt.changenotetype import ChangeNotetypeDialog
|
||||||
|
@ -730,6 +731,19 @@ def _extract_collection_post_request(path: str) -> DynamicRequest | NotFound:
|
||||||
response.headers["Content-Type"] = "application/binary"
|
response.headers["Content-Type"] = "application/binary"
|
||||||
else:
|
else:
|
||||||
response = _text_response(HTTPStatus.NO_CONTENT, "")
|
response = _text_response(HTTPStatus.NO_CONTENT, "")
|
||||||
|
except BackendError as e:
|
||||||
|
# special case empty file error from csv import
|
||||||
|
if "empty" in str(e).lower():
|
||||||
|
|
||||||
|
def warn() -> None:
|
||||||
|
show_warning(
|
||||||
|
"The file you selected is empty and cannot be imported."
|
||||||
|
)
|
||||||
|
|
||||||
|
aqt.mw.taskman.run_on_main(warn)
|
||||||
|
return _text_response(HTTPStatus.NO_CONTENT, "")
|
||||||
|
else:
|
||||||
|
response = _text_response(HTTPStatus.INTERNAL_SERVER_ERROR, str(e))
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
print(traceback.format_exc())
|
print(traceback.format_exc())
|
||||||
response = _text_response(HTTPStatus.INTERNAL_SERVER_ERROR, str(exc))
|
response = _text_response(HTTPStatus.INTERNAL_SERVER_ERROR, str(exc))
|
||||||
|
|
Loading…
Reference in a new issue