gnowledge/gstudio — pull request #911 by AvadootNachankar (2014-11-16 19:01:01+00:00)
Title: Bug fix - Upload Profile Pic

* **Bug fix for upload profile-pic in User's dashboard**

* **Run following commands in given order:**
```
python manage.py sync_existing_documents
python manage.py filldb -nc
```

1. templates/ndf/base.html
- Passing primary key of logged in user to ```get_profile_pic```; previously passing whole User object

2. templatetags/ndf_tags.py
- ```get_profile_pic()``` modified: Code optimized to get profile pic uploaded by logged-in user

3. templates/ndf/uDashboard.html
- Renamed name attribute of file html element used for uploading profile pic from *doc[]* to **has_profile_pic**
- Renamed template context variable from *already_uploaded* to **already_set**

4. views/userDashboard.py
- ```uDashboard()``` modified: Code optimized to handle every possible use-cases of profile pic uploading by logged-in user

5. views/file.py
- ```submitDoc()``` modified: Url rectified from *uDashboard* to **dashboard**

6. views/ajax_views.py
- Syntax issue fixed: Incomplete dict rectified, i.e. {'_id'} to {'_id': 1}
- {'status': u"PUBLISHED"} added to required queries

7. management/commands/sync_existing_documents.py
- Updates already created has_profile_pic grelations' status - Except latest one set to PUBLISHED, others' are set to DELETED

8. management/commands/filldb.py
- ```clean_structure()``` modified
- Query updated (added {'status': "PUBLISHED"}) that updates node's relation_set & attribute_set; so that only updated values are attached to that node
- start_time & end_time rectification code updated: Now considers hours & time string as well for rectification