@ -7,6 +7,33 @@ import requests
|
||||
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="to be written")
|
||||
def test_note_device_no_blank_note():
|
||||
""" The field is set to blank=true, ensure that a blank note cant be saved
|
||||
|
||||
field had to be set blank=true so that other forms on same page could be saved.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="to be written")
|
||||
def test_note_operating_system_no_blank_note():
|
||||
""" The field is set to blank=true, ensure that a blank note cant be saved
|
||||
|
||||
field had to be set blank=true so that other forms on same page could be saved.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="to be written")
|
||||
def test_note_software_no_blank_note():
|
||||
""" The field is set to blank=true, ensure that a blank note cant be saved
|
||||
|
||||
field had to be set blank=true so that other forms on same page could be saved.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="to be written")
|
||||
def test_note_new_correct_usercreated():
|
||||
""" The user who added the note must be added to the note """
|
||||
|
@ -125,7 +125,7 @@ class View(OrganizationPermission, generic.UpdateView):
|
||||
|
||||
notes = AddNoteForm(request.POST, prefix='note')
|
||||
|
||||
if notes.is_bound and notes.is_valid():
|
||||
if notes.is_bound and notes.is_valid() and notes.instance.note != '':
|
||||
|
||||
notes.instance.organization = device.organization
|
||||
notes.instance.device = device
|
||||
|
@ -59,7 +59,7 @@ class View(OrganizationPermission, generic.UpdateView):
|
||||
context['notes'] = Notes.objects.filter(operatingsystem=self.kwargs['pk'])
|
||||
|
||||
context['model_pk'] = self.kwargs['pk']
|
||||
context['model_name'] = 'operating_system'
|
||||
context['model_name'] = self.model._meta.verbose_name.replace(' ', '')
|
||||
|
||||
|
||||
context['content_title'] = self.object.name
|
||||
@ -73,7 +73,7 @@ class View(OrganizationPermission, generic.UpdateView):
|
||||
|
||||
notes = AddNoteForm(request.POST, prefix='note')
|
||||
|
||||
if notes.is_bound and notes.is_valid():
|
||||
if notes.is_bound and notes.is_valid() and notes.instance.note != '':
|
||||
|
||||
notes.instance.organization = operatingsystem.organization
|
||||
notes.instance.operatingsystem = operatingsystem
|
||||
|
@ -88,7 +88,7 @@ class View(OrganizationPermission, generic.UpdateView):
|
||||
|
||||
notes = AddNoteForm(request.POST, prefix='note')
|
||||
|
||||
if notes.is_bound and notes.is_valid():
|
||||
if notes.is_bound and notes.is_valid() and notes.instance.note != '':
|
||||
|
||||
notes.instance.organization = software.organization
|
||||
notes.instance.software = software
|
||||
|
Reference in New Issue
Block a user