@ -6,6 +6,29 @@ from access.mixin import OrganizationPermission
|
||||
from ..models.software import Software, SoftwareVersion
|
||||
|
||||
|
||||
class View(OrganizationPermission, generic.UpdateView):
|
||||
model = SoftwareVersion
|
||||
permission_required = [
|
||||
'itam.view_softwareversion'
|
||||
]
|
||||
template_name = 'form.html.j2'
|
||||
|
||||
fields = [
|
||||
"name",
|
||||
]
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
|
||||
context['content_title'] = self.object.name
|
||||
|
||||
return context
|
||||
|
||||
def get_success_url(self, **kwargs):
|
||||
|
||||
return f"/itam/software/{self.kwargs['software_id']}/"
|
||||
|
||||
|
||||
|
||||
class Add(PermissionRequiredMixin, OrganizationPermission, generic.CreateView):
|
||||
model = SoftwareVersion
|
||||
|
||||
Reference in New Issue
Block a user