widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #13254
[Merge] lp:~widelands-dev/widelands-website/fix_django1_11_warnings into lp:widelands-website
kaputtnik has proposed merging lp:~widelands-dev/widelands-website/fix_django1_11_warnings into lp:widelands-website.
Requested reviews:
Widelands Developers (widelands-dev)
Related bugs:
Bug #1767286 in Widelands Website: "Fix UnorderedObjectListWarning"
https://bugs.launchpad.net/widelands-website/+bug/1767286
For more details, see:
https://code.launchpad.net/~widelands-dev/widelands-website/fix_django1_11_warnings/+merge/344973
Fix for UnorderedObjectListWarning.
Fixes a server error when accessing modul index in the documentation
--
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands-website/fix_django1_11_warnings into lp:widelands-website.
=== modified file 'online_users_middleware.py'
--- online_users_middleware.py 2018-04-11 18:09:25 +0000
+++ online_users_middleware.py 2018-05-02 18:05:52 +0000
@@ -37,7 +37,7 @@
online_now_ids = [int(k.replace('online-', '')) for k in fresh]
# If the user is authenticated, add their id to the list
- if request.user.is_authenticated():
+ if request.user.is_authenticated:
uid = request.user.id
# If their uid is already in the list, we want to bump it
# to the top, so we remove the earlier entry.
=== modified file 'templates/sphinxdoc/py-modindex.html'
--- templates/sphinxdoc/py-modindex.html 2016-08-07 18:35:30 +0000
+++ templates/sphinxdoc/py-modindex.html 2018-05-02 18:05:52 +0000
@@ -2,12 +2,9 @@
{% block doc_body %}
<h1>Module Index</h1>
- {% for index in doc.content.0.items %}
- <p>index: {{index}}</p>
-{% endfor %}
- <dl>
- {% for c in doc.content.0 %}
- {% for modul, level, fname, mainmod, unknown1, unknown2, descr in c %}
+ <dl>
+ {% for c in doc.content %}
+ {% for modul, level, fname, mainmod, unknown1, unknown2, descr in c.1 %}
{% if level < 2 %}
<dt><a href="../{{ fname }}">{{ modul }}</a></dt>
<dd>{{ descr }}
@@ -16,18 +13,10 @@
<dt><a href="../{{ fname }}">{{ modul }}</a></dt>
<dd>{{ descr }}</dd>
</dl>
-
{% endif %}
{% endfor %}
</dd>
{% endfor %}
-
- {% comment %}
- {% for modname, collapse, cgroup, indent, fname, synops, pform, dep in doc.content.0 %}
- <dt><a href="{{ fname }}"><tt class="literal xref">{{ modname }}</tt></a></dt>
- <dd>{{ synops }}</dd>
- {% endfor %}
- {% endcomment %}
</dl>
<br />
{% endblock doc_body %}
=== modified file 'wiki/models.py'
--- wiki/models.py 2018-04-08 14:40:17 +0000
+++ wiki/models.py 2018-05-02 18:05:52 +0000
@@ -71,6 +71,7 @@
verbose_name_plural = _(u'Articles')
app_label = 'wiki'
default_permissions = ('change', 'add',)
+ ordering = ['title']
def get_absolute_url(self):
if self.group is None:
=== modified file 'wlhelp/models.py'
--- wlhelp/models.py 2018-03-06 17:11:15 +0000
+++ wlhelp/models.py 2018-05-02 18:05:52 +0000
@@ -8,6 +8,10 @@
icon_url = models.CharField(max_length=256)
network_pdf_url = models.CharField(max_length=256)
network_gif_url = models.CharField(max_length=256)
+
+ class Meta:
+ ordering = ['name']
+
def __unicode__(self):
return u'%s' % self.name
@@ -30,6 +34,10 @@
becomes = models.OneToOneField(
'self', related_name='trained_by_experience', blank=True, null=True)
+ class Meta:
+ ordering = ['name']
+
+
def __unicode__(self):
return u'%s' % self.name
@@ -46,10 +54,11 @@
# This limit shall probably cover the longest help (found 209, nothing
# more)
help = models.TextField(max_length=256)
-
+
class Meta:
ordering = ['name']
+
def __unicode__(self):
return u'%s' % self.name
@@ -138,6 +147,10 @@
Ware, related_name='produced_by_buildings', blank=True)
output_workers = models.ManyToManyField(
Worker, related_name='trained_by_buildings', blank=True)
+
+ class Meta:
+ ordering = ['name']
+
def save(self, *args, **kwargs):
Follow ups