NSSatIITM/nss — Issue #28: Separate the update and the MOM
Author: praveenv253
Created: 2012-01-27 18:21:39+00:00
State: open
Labels: Backend

As I see it, the easy way to do this is to keep most of the infrastructure in place and make minor modifications to just the form.

The ```Update``` model currently contains both a text field as well as a file upload field. What Girish basically wants is to either display only the text (in which case it becomes an external update which everyone can see), or it contains the file name as the text as well as the file (in which case it becomes an internal update which only logged in people can see).

Everything basically hinges on whether or not the ```FileField``` object is ```None``` after the form has been created from the post data (```form = UpdateForm(request.POST, request.FILES)```) . We'll need to accordingly rewrite the form validation as well as the template. Suitable help text also needs to be provided.

Finally, the project details template also needs to be changed since that's where we are displaying the update. We can check whether or not the FileField is True and then display whatever depending upon whether or not the user is logged in.