Skip to content

Commit cdf30c6

Browse files
committed
remove end_date_extension from allocation views
1 parent 5d64709 commit cdf30c6

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

coldfront/core/allocation/views.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1705,14 +1705,14 @@ def get(self, request, *args, **kwargs):
17051705
allocation_change_form = AllocationChangeForm(
17061706
initial={
17071707
'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,
17091709
}
17101710
)
17111711
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
17161716

17171717
note_form = AllocationChangeNoteForm(
17181718
initial={'notes': allocation_change_obj.notes}
@@ -1741,7 +1741,7 @@ def post(self, request, *args, **kwargs):
17411741
request.POST,
17421742
initial={
17431743
'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,
17451745
},
17461746
)
17471747
allocation_change_form.fields['justification'].required = False
@@ -1810,14 +1810,14 @@ def post(self, request, *args, **kwargs):
18101810
return self.redirect_to_detail(pk)
18111811

18121812
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')
18141814

1815-
if not attrs_to_change and end_date_extension == 0:
1815+
if not attrs_to_change:# and end_date_extension == 0:
18161816
messages.error(request, 'You must make a change to the allocation.')
18171817
return self.redirect_to_detail(pk)
18181818

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
18211821

18221822
if attrs_to_change:
18231823
for entry in formset:
@@ -1838,11 +1838,11 @@ def post(self, request, *args, **kwargs):
18381838
)
18391839
alloc_change_obj.status = status_approved_obj
18401840

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()
18461846

18471847
if attrs_to_change:
18481848
attr_changes = (
@@ -2013,8 +2013,8 @@ def post(self, request, *args, **kwargs):
20132013

20142014
form_data = form.cleaned_data
20152015

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
20182018

20192019
# if requested resource is on NESE, add to vars
20202020
nese = bool(allocation_obj.resources.filter(name__contains="nesetape"))
@@ -2041,13 +2041,13 @@ def post(self, request, *args, **kwargs):
20412041
messages.error(request, 'You must request a change.')
20422042
return HttpResponseRedirect(reverse('allocation-change', kwargs={'pk': pk}))
20432043

2044-
end_date_extension = form_data.get('end_date_extension')
2044+
# end_date_extension = form_data.get('end_date_extension')
20452045
justification = form_data.get('justification')
20462046
change_request_status = AllocationChangeStatusChoice.objects.get(name='Pending')
20472047

20482048
allocation_change_request_obj = AllocationChangeRequest.objects.create(
20492049
allocation=allocation_obj,
2050-
end_date_extension=end_date_extension,
2050+
# end_date_extension=end_date_extension,
20512051
justification=justification,
20522052
status=change_request_status,
20532053
)

0 commit comments

Comments
 (0)