@@ -1705,14 +1705,14 @@ def get(self, request, *args, **kwargs):
1705
1705
allocation_change_form = AllocationChangeForm (
1706
1706
initial = {
1707
1707
'justification' : allocation_change_obj .justification ,
1708
- 'end_date_extension' : allocation_change_obj .end_date_extension ,
1708
+ # 'end_date_extension': allocation_change_obj.end_date_extension,
1709
1709
}
1710
1710
)
1711
1711
allocation_change_form .fields ['justification' ].disabled = True
1712
- if allocation_change_obj .status .name != 'Pending' :
1713
- allocation_change_form .fields ['end_date_extension' ].disabled = True
1714
- if not self .request .user .is_staff and not self .request .user .is_superuser :
1715
- allocation_change_form .fields ['end_date_extension' ].disabled = True
1712
+ # if allocation_change_obj.status.name != 'Pending':
1713
+ # allocation_change_form.fields['end_date_extension'].disabled = True
1714
+ # if not self.request.user.is_staff and not self.request.user.is_superuser:
1715
+ # allocation_change_form.fields['end_date_extension'].disabled = True
1716
1716
1717
1717
note_form = AllocationChangeNoteForm (
1718
1718
initial = {'notes' : allocation_change_obj .notes }
@@ -1741,7 +1741,7 @@ def post(self, request, *args, **kwargs):
1741
1741
request .POST ,
1742
1742
initial = {
1743
1743
'justification' : alloc_change_obj .justification ,
1744
- 'end_date_extension' : alloc_change_obj .end_date_extension ,
1744
+ # 'end_date_extension': alloc_change_obj.end_date_extension,
1745
1745
},
1746
1746
)
1747
1747
allocation_change_form .fields ['justification' ].required = False
@@ -1810,14 +1810,14 @@ def post(self, request, *args, **kwargs):
1810
1810
return self .redirect_to_detail (pk )
1811
1811
1812
1812
form_data = allocation_change_form .cleaned_data
1813
- end_date_extension = form_data .get ('end_date_extension' )
1813
+ # end_date_extension = form_data.get('end_date_extension')
1814
1814
1815
- if not attrs_to_change and end_date_extension == 0 :
1815
+ if not attrs_to_change : # and end_date_extension == 0:
1816
1816
messages .error (request , 'You must make a change to the allocation.' )
1817
1817
return self .redirect_to_detail (pk )
1818
1818
1819
- if end_date_extension != alloc_change_obj .end_date_extension :
1820
- alloc_change_obj .end_date_extension = end_date_extension
1819
+ # if end_date_extension != alloc_change_obj.end_date_extension:
1820
+ # alloc_change_obj.end_date_extension = end_date_extension
1821
1821
1822
1822
if attrs_to_change :
1823
1823
for entry in formset :
@@ -1838,11 +1838,11 @@ def post(self, request, *args, **kwargs):
1838
1838
)
1839
1839
alloc_change_obj .status = status_approved_obj
1840
1840
1841
- if alloc_change_obj .end_date_extension > 0 :
1842
- rdelta = relativedelta (days = ALLOCATION_DEFAULT_ALLOCATION_LENGTH )
1843
- new_end_date = alloc_change_obj .allocation .end_date + rdelta
1844
- alloc_change_obj .allocation .end_date = new_end_date
1845
- alloc_change_obj .allocation .save ()
1841
+ # if alloc_change_obj.end_date_extension > 0:
1842
+ # rdelta = relativedelta(days=ALLOCATION_DEFAULT_ALLOCATION_LENGTH)
1843
+ # new_end_date = alloc_change_obj.allocation.end_date + rdelta
1844
+ # alloc_change_obj.allocation.end_date = new_end_date
1845
+ # alloc_change_obj.allocation.save()
1846
1846
1847
1847
if attrs_to_change :
1848
1848
attr_changes = (
@@ -2013,8 +2013,8 @@ def post(self, request, *args, **kwargs):
2013
2013
2014
2014
form_data = form .cleaned_data
2015
2015
2016
- if form_data .get ('end_date_extension' ) != 0 :
2017
- change_requested = True
2016
+ # if form_data.get('end_date_extension') != 0:
2017
+ # change_requested = True
2018
2018
2019
2019
# if requested resource is on NESE, add to vars
2020
2020
nese = bool (allocation_obj .resources .filter (name__contains = "nesetape" ))
@@ -2041,13 +2041,13 @@ def post(self, request, *args, **kwargs):
2041
2041
messages .error (request , 'You must request a change.' )
2042
2042
return HttpResponseRedirect (reverse ('allocation-change' , kwargs = {'pk' : pk }))
2043
2043
2044
- end_date_extension = form_data .get ('end_date_extension' )
2044
+ # end_date_extension = form_data.get('end_date_extension')
2045
2045
justification = form_data .get ('justification' )
2046
2046
change_request_status = AllocationChangeStatusChoice .objects .get (name = 'Pending' )
2047
2047
2048
2048
allocation_change_request_obj = AllocationChangeRequest .objects .create (
2049
2049
allocation = allocation_obj ,
2050
- end_date_extension = end_date_extension ,
2050
+ # end_date_extension=end_date_extension,
2051
2051
justification = justification ,
2052
2052
status = change_request_status ,
2053
2053
)
0 commit comments