[solr] Installing solr examples gives error
# See the License for the specific language governing permissions and
# limitations under the License.
+import sys
import logging
from django.core import management
@@ -43,6 +44,9 @@ class Command(BaseCommand):
if not Document2.objects.filter(type='search-dashboard', owner__username__in=SAMPLE_USER_OWNERS).exists():
with transaction.atomic():
+ 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()
