Only create the initial document type and web source if none exists.
This commit is contained in:
@@ -6,4 +6,5 @@ from .models import DocumentType
|
||||
|
||||
|
||||
def create_default_document_type(sender, **kwargs):
|
||||
DocumentType.objects.create(label=_('Default'))
|
||||
if not DocumentType.objects.count():
|
||||
DocumentType.objects.create(label=_('Default'))
|
||||
|
||||
@@ -9,9 +9,10 @@ from .models import POP3Email, IMAPEmail, WatchFolderSource, WebFormSource
|
||||
|
||||
|
||||
def create_default_document_source(sender, **kwargs):
|
||||
WebFormSource.objects.create(
|
||||
label=_('Default'), uncompress=SOURCE_UNCOMPRESS_CHOICE_ASK
|
||||
)
|
||||
if not WebFormSource.objects.count():
|
||||
WebFormSource.objects.create(
|
||||
label=_('Default'), uncompress=SOURCE_UNCOMPRESS_CHOICE_ASK
|
||||
)
|
||||
|
||||
|
||||
def copy_transformations_to_version(sender, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user