Menu

#482 viewers.py shows the DB-escaped version of the submission

v1.0 (example)
closed-fixed
None
5
2014-01-15
2014-01-15
Ahasuerus
No

viewers.py shows the DB-escaped version of the submission, which means that carriage returns appear as "\n" and backslashes are doubled. There reason for it is that the /mod scripts db-escape all values as they build the submission body, so by the time it is passed to viewers.py, it's already DB-escaped and there is no standard way to unescape it.

There are two ways to fix this fairly minor problem. The first one is not to db-escape the body of the submission until the very end. This is probably preferred because it's safer to DB-escape one string than a whole bunch of them. The second one is to create a manual "unescape" function which will undo the DB-escaping before displaying the text.

Discussion

  • Ahasuerus

    Ahasuerus - 2014-01-15
    • status: open --> closed-fixed
    • assigned_to: Ahasuerus
     
  • Ahasuerus

    Ahasuerus - 2014-01-15

    Fixed by making all approval pages pass the submission ID to viewers.py, which would then load the page. Affected modules:

     common/viewers.py 1.13
    edit/as_merge.py 1.9
    edit/editawardtype.py 1.5
    edit/submitauth.py 1.18
    edit/submitawardtype.py 1.6
    edit/submitpublisher.py 1.9
    edit/submitpubseries.py 1.7
    mod/av_merge.py 1.5
    mod/av_update.py 1.5
    mod/award_type_update_display.py 1.2
    mod/xv_update.py 1.3
    mod/zv_update.py 1.2
    

    Installed in r2014-24 on 2014-01-15. Closing.

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB