← Back to team overview

widelands-dev team mailing list archive

Re: [Merge] lp:~widelands-dev/widelands-website/post_django1_8_cleanup into lp:widelands-website

 

Code LGTM, a typo and a question in the comments, not tested.

On Widelands, we have the convention of not having a blank space in the TODO comments, like this:

    TODO(Franku):

Maybe you will want to follow that here too? Having a uniform format will make it easier to grep things.

Diff comments:

> 
> === modified file 'threadedcomments/templatetags/threadedcommentstags.py'
> --- threadedcomments/templatetags/threadedcommentstags.py	2016-12-13 18:28:51 +0000
> +++ threadedcomments/templatetags/threadedcommentstags.py	2017-01-21 20:06:44 +0000
> @@ -136,34 +136,12 @@
>  
>  def auto_transform_markup(comment):
>      """Given a comment (``ThreadedComment`` or ``FreeThreadedComment``), this
> -    tag looks up the markup type of the comment and formats the output
> -    accordingly.
> -
> -    It can also output the formatted content to a context variable, if a
> -    context name is specified.
> +    tag simply returns the commetn after wl_markdown runs over it.

commetn -> comment

>  
>      """
> -    # NOCOMM franku: django.contrib.markup doesn't exist anymore
> -    try:
> -        from django.utils.html import escape
> -        from threadedcomments.models import MARKDOWN, TEXTILE, REST, PLAINTEXT
> -        if comment.markup == MARKDOWN:
> -            from django.contrib.markup.templatetags.markup import markdown
> -            return markdown(comment.comment)
> -        elif comment.markup == TEXTILE:
> -            from django.contrib.markup.templatetags.markup import textile
> -            return textile(comment.comment)
> -        elif comment.markup == REST:
> -            from django.contrib.markup.templatetags.markup import restructuredtext
> -            return restructuredtext(comment.comment)
> -#        elif comment.markup == HTML:
> -#            return mark_safe(force_unicode(comment.comment))
> -        elif comment.markup == PLAINTEXT:
> -            return escape(comment.comment)
> -    except ImportError:
> -        # Not marking safe, in case tag fails and users input malicious code.
> -        # NOCOMM franku: bleach the comment
> -        return do_wl_markdown(comment.comment, 'bleachit')
> +    
> +    # Franku: bleach the comment

TODO?

> +    return do_wl_markdown(comment.comment, 'bleachit')
>  
>  
>  def do_auto_transform_markup(parser, token):


-- 
https://code.launchpad.net/~widelands-dev/widelands-website/post_django1_8_cleanup/+merge/315301
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands-website/post_django1_8_cleanup into lp:widelands-website.


References