|
|
@@ -15,6 +15,7 @@
|
|
|
# See the License for the specific language governing permissions and
|
|
|
# limitations under the License.
|
|
|
|
|
|
+import sys
|
|
|
import logging
|
|
|
|
|
|
from django.core import management
|
|
|
@@ -43,7 +44,10 @@ class Command(BaseCommand):
|
|
|
|
|
|
if not Document2.objects.filter(type='search-dashboard', owner__username__in=SAMPLE_USER_OWNERS).exists():
|
|
|
with transaction.atomic():
|
|
|
- management.call_command('loaddata', 'initial_search_examples.json', verbosity=2, commit=False)
|
|
|
+ if sys.version_info[0] > 2:
|
|
|
+ management.call_command('loaddata', 'initial_search_examples.json', verbosity=2)
|
|
|
+ else:
|
|
|
+ management.call_command('loaddata', 'initial_search_examples.json', verbosity=2, commit=False)
|
|
|
Document.objects.sync()
|
|
|
|
|
|
Document2.objects.filter(type='search-dashboard', owner__username__in=SAMPLE_USER_OWNERS).update(parent_directory=examples_dir)
|