learning-unlimited / ESP-Website

A website to help manage the logistics of large, short-term educational programs
84 stars 57 forks source link

Classes with 0 students and capacity 0 are marked as "Full" #293

Closed pricem closed 12 years ago

pricem commented 12 years ago

The catalog displays with all classes collapsed and marked "Full" before the classes have been scheduled. It would be nice if we didn't consider 0/0 to be "full" so people didn't get confused when looking at an early catalog.

mrabhiram commented 12 years ago

Hello pricem , I would like to work on this bug. I am abhiram. I would like to in detail what the code looks like. Perhaps, we could solve it by controlling the mark "full" depending upon the no.of students and capacity. Please , reply to this issue.

pricem commented 12 years ago

Hi Abhiram,

Thanks for offering to help! I think the best way to approach this is to edit the ClassSection.isFull() function (esp/esp/program/models/class_.py:1119) to specifically handle the case of capacity = 0 and num_students = 0. This function is called in several places in our code, including from the template (esp/templates/inclusion/program/class_catalogcore.html) that displays the "Full!" note on the catalog. Note that the template is actually calling ClassSubject.isFull() (esp/esp/program/models/class.py:1673), which then calls ClassSection.isFull() for each of the class's sections.

If you've addressed this ticket on your dev server, feel free to submit a patch or pull request and I can get it merged.

Thanks Michael

mrabhiram commented 12 years ago

Hi Picem, I have figured out a way. We could control it by checking whether if the students and capacity are both 0, and respond false to that. Because we do not want users to understand it is full, if the classroom is actually not full, right? I will send a patch to that soon. Please, reply soon.

pricem commented 12 years ago

That sounds like a good approach to me.

mrabhiram commented 12 years ago

i have made the changes that are necessary. Could you help me in doing a patch. I am having problem with that what is the command that will make a patch to the existing code?

mrabhiram commented 12 years ago

On Mon, Mar 19, 2012 at 5:57 PM, Michael Price < reply@reply.github.com

wrote:

That sounds like a good approach to me.


Reply to this email directly or view it on GitHub:

https://github.com/learning-unlimited/ESP-Website/issues/293#issuecomment-4572185

Hello Micheal, Here is the patch. I have made it by "diff" command. Let me know if you need it by git format. I am trying do it in git format, somehow it doesn't show up. Any ways, the changes i have made is that i have returned "false" , if students=capacity=0. so that it doesn't take it as "Full".

Regards, Abhiram

mrabhiram commented 12 years ago

hello michael, I attached the patch and sent it to your gmail account. Please check and reply soon.

pricem commented 12 years ago

Thanks Abhiram! I'm confused though, since I don't have a gmail account. Can you try sending the patch to price@learningu.org?

pricem commented 12 years ago

I got the patch and applied it. The code was missing colons after the if and else statements, but once I took care of that it worked well. Thanks to Abhiram for contributing a fix!