~widelands-dev/widelands-website/django_staticfiles

« back to all changes in this revision

Viewing changes to pybb/util.py

  • Committer: franku
  • Date: 2018-04-26 20:18:55 UTC
  • mfrom: (489.1.28 widelands)
  • Revision ID: somal@arcor.de-20180426201855-uwt3b8gptpav6wrm
updated code base to fit with django 1.11.12; replaced app tracking with a new middleware

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 
6
6
from BeautifulSoup import BeautifulSoup
7
7
from datetime import datetime
8
 
from django.shortcuts import render_to_response
9
 
from django.template import RequestContext
 
8
from django.shortcuts import render
10
9
from django.http import HttpResponse
11
10
from django.utils.functional import Promise
12
11
from django.utils.translation import check_for_language
32
31
            output = func(request, *args, **kwargs)
33
32
            if not isinstance(output, dict):
34
33
                return output
35
 
            kwargs = {'context_instance': RequestContext(request)}
 
34
            
36
35
 
37
36
            # TODO(Franku): 'MIME_TYPE' is never in output as i can see for now.
38
37
            # But if, this should maybe 'content_type' instead
43
42
            else:
44
43
                template = template_path
45
44
 
46
 
            return render_to_response(template, output, **kwargs)
 
45
            return render(request, template, output)
47
46
        return wrapper
48
47
 
49
48
    return decorator