ubccr / coldfront

HPC Resource Allocation System
https://coldfront.readthedocs.io
GNU General Public License v3.0
96 stars 76 forks source link

fix misfiring success message, remove redundant function #557

Closed claire-peters closed 11 months ago

claire-peters commented 11 months ago

Learned earlier today that the post function for the AllocationCreateView was the wrong way to add a success message - it presents the success message even when an error is present on the form. This push corrects that error. It also contains the removal of an unneeded method - the AllocationAddInvoiceNoteView had two get_context_data methods and the second one is the one that would have been in operation, so I deleted the first.

claire-peters commented 11 months ago

I kept the second because it's the only one that's actually been in use - you can see in the commit where the first was added that it was all added preceding the second get_context_data method, meaning this code has never actually run. I can't really attest to the business logic of the new method for that reason, so I went with the one that's been in use.

That said, I'm happy to instead test the new/first get_context_data function, make sure it works, and remove the older function. Just let me know!

claire-peters commented 11 months ago

An additional observation makes the solution even easier - the business logic in the longer get_context_data method is taken straight from AllocationDetailView and has no business being in the AllocationAddInvoiceNoteView class. The second method is definitely the right one.

aebruno commented 11 months ago

An additional observation makes the solution even easier - the business logic in the longer get_context_data method is taken straight from AllocationDetailView and has no business being in the AllocationAddInvoiceNoteView class. The second method is definitely the right one.

@claire-peters Thanks, yes just noticed this as well. Looks good to me!