mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-20 15:02:31 +00:00
Added asset_id autofill for asset creation and duplication
This commit is contained in:
@@ -89,12 +89,16 @@ class AssetCreate(LoginRequiredMixin, generic.CreateView):
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super(AssetCreate, self).get_context_data(**kwargs)
|
||||
|
||||
context["create"] = True
|
||||
context["connectors"] = models.Connector.objects.all()
|
||||
|
||||
return context
|
||||
|
||||
def get_initial(self, *args, **kwargs):
|
||||
initial = super().get_initial(*args, **kwargs)
|
||||
initial["asset_id"] = models.Asset.get_available_asset_id()
|
||||
return initial
|
||||
|
||||
def get_success_url(self):
|
||||
return reverse("asset_detail", kwargs={"pk": self.object.id})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user