Files
mayan-edms/mayan/apps/checkouts/exceptions.py
Roberto Rosario 6c6ca38374 Replace all instances of unicode only handling to use force_text.
Replace all __unicode__ methods to __str__ and the
@python_2_unicode_compatible decorator.
Replace all instance of smart_str, smart_unicode, force_uncode
with force_text.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-07-05 15:03:24 -04:00

35 lines
786 B
Python

from __future__ import unicode_literals
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext
class DocumentCheckoutError(Exception):
"""
Base checkout exception
"""
pass
class DocumentNotCheckedOut(DocumentCheckoutError):
"""
Raised when trying to checkin a document that is not checkedout
"""
pass
@python_2_unicode_compatible
class DocumentAlreadyCheckedOut(DocumentCheckoutError):
"""
Raised when trying to checkout an already checkedout document
"""
def __str__(self):
return ugettext('Document already checked out.')
class NewDocumentVersionNotAllowed(DocumentCheckoutError):
"""
Uploading new versions for this document is not allowed
"""
pass