Revert to old method of sample data gen

bulk_create is super quick, but no autoincrement on sqlite is killer when trying to run tests.
This commit is contained in:
2021-02-07 14:40:15 +00:00
parent 788fb3efe6
commit ef1d9868da
15 changed files with 324 additions and 339 deletions

View File

@@ -13,6 +13,7 @@ from django.views.decorators.csrf import csrf_exempt
from PyRIGS.views import GenericListView, GenericDetailView, GenericUpdateView, GenericCreateView, ModalURLMixin, \
is_ajax, OEmbedView
from assets import forms, models
from assets.models import get_available_asset_id
class AssetList(LoginRequiredMixin, generic.ListView):
@@ -139,7 +140,7 @@ class AssetCreate(LoginRequiredMixin, generic.CreateView):
def get_initial(self, *args, **kwargs):
initial = super().get_initial(*args, **kwargs)
initial["asset_id"] = models.Asset.get_available_asset_id()
initial["asset_id"] = get_available_asset_id()
return initial
def get_success_url(self):