Merge lp:~widelands-dev/widelands-website/fix_django1_11_warnings into lp:widelands-website

Proposed by kaputtnik
Status: Merged
Merged at revision: 493
Proposed branch: lp:~widelands-dev/widelands-website/fix_django1_11_warnings
Merge into: lp:widelands-website
Diff against target: 112 lines (+19/-16)
4 files modified
online_users_middleware.py (+1/-1)
templates/sphinxdoc/py-modindex.html (+3/-14)
wiki/models.py (+1/-0)
wlhelp/models.py (+14/-1)
To merge this branch: bzr merge lp:~widelands-dev/widelands-website/fix_django1_11_warnings
Reviewer Review Type Date Requested Status
GunChleoc Approve
Review via email: mp+344973@code.launchpad.net

Description of the change

Fix for UnorderedObjectListWarning.

Fixes a server error when accessing modul index in the documentation

To post a comment you must log in.
Revision history for this message
GunChleoc (gunchleoc) wrote :

Looks good :)

review: Approve
Revision history for this message
kaputtnik (franku) wrote :

Thanks :-)

Merged and deployed.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'online_users_middleware.py'
2--- online_users_middleware.py 2018-04-11 18:09:25 +0000
3+++ online_users_middleware.py 2018-05-02 18:05:52 +0000
4@@ -37,7 +37,7 @@
5 online_now_ids = [int(k.replace('online-', '')) for k in fresh]
6
7 # If the user is authenticated, add their id to the list
8- if request.user.is_authenticated():
9+ if request.user.is_authenticated:
10 uid = request.user.id
11 # If their uid is already in the list, we want to bump it
12 # to the top, so we remove the earlier entry.
13
14=== modified file 'templates/sphinxdoc/py-modindex.html'
15--- templates/sphinxdoc/py-modindex.html 2016-08-07 18:35:30 +0000
16+++ templates/sphinxdoc/py-modindex.html 2018-05-02 18:05:52 +0000
17@@ -2,12 +2,9 @@
18
19 {% block doc_body %}
20 <h1>Module Index</h1>
21- {% for index in doc.content.0.items %}
22- <p>index: {{index}}</p>
23-{% endfor %}
24- <dl>
25- {% for c in doc.content.0 %}
26- {% for modul, level, fname, mainmod, unknown1, unknown2, descr in c %}
27+ <dl>
28+ {% for c in doc.content %}
29+ {% for modul, level, fname, mainmod, unknown1, unknown2, descr in c.1 %}
30 {% if level < 2 %}
31 <dt><a href="../{{ fname }}">{{ modul }}</a></dt>
32 <dd>{{ descr }}
33@@ -16,18 +13,10 @@
34 <dt><a href="../{{ fname }}">{{ modul }}</a></dt>
35 <dd>{{ descr }}</dd>
36 </dl>
37-
38 {% endif %}
39 {% endfor %}
40 </dd>
41 {% endfor %}
42-
43- {% comment %}
44- {% for modname, collapse, cgroup, indent, fname, synops, pform, dep in doc.content.0 %}
45- <dt><a href="{{ fname }}"><tt class="literal xref">{{ modname }}</tt></a></dt>
46- <dd>{{ synops }}</dd>
47- {% endfor %}
48- {% endcomment %}
49 </dl>
50 <br />
51 {% endblock doc_body %}
52
53=== modified file 'wiki/models.py'
54--- wiki/models.py 2018-04-08 14:40:17 +0000
55+++ wiki/models.py 2018-05-02 18:05:52 +0000
56@@ -71,6 +71,7 @@
57 verbose_name_plural = _(u'Articles')
58 app_label = 'wiki'
59 default_permissions = ('change', 'add',)
60+ ordering = ['title']
61
62 def get_absolute_url(self):
63 if self.group is None:
64
65=== modified file 'wlhelp/models.py'
66--- wlhelp/models.py 2018-03-06 17:11:15 +0000
67+++ wlhelp/models.py 2018-05-02 18:05:52 +0000
68@@ -8,6 +8,10 @@
69 icon_url = models.CharField(max_length=256)
70 network_pdf_url = models.CharField(max_length=256)
71 network_gif_url = models.CharField(max_length=256)
72+
73+ class Meta:
74+ ordering = ['name']
75+
76
77 def __unicode__(self):
78 return u'%s' % self.name
79@@ -30,6 +34,10 @@
80 becomes = models.OneToOneField(
81 'self', related_name='trained_by_experience', blank=True, null=True)
82
83+ class Meta:
84+ ordering = ['name']
85+
86+
87 def __unicode__(self):
88 return u'%s' % self.name
89
90@@ -46,10 +54,11 @@
91 # This limit shall probably cover the longest help (found 209, nothing
92 # more)
93 help = models.TextField(max_length=256)
94-
95+
96 class Meta:
97 ordering = ['name']
98
99+
100 def __unicode__(self):
101 return u'%s' % self.name
102
103@@ -138,6 +147,10 @@
104 Ware, related_name='produced_by_buildings', blank=True)
105 output_workers = models.ManyToManyField(
106 Worker, related_name='trained_by_buildings', blank=True)
107+
108+ class Meta:
109+ ordering = ['name']
110+
111
112 def save(self, *args, **kwargs):
113

Subscribers

People subscribed via source and target branches