← Back to team overview

widelands-dev team mailing list archive

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

 

1 Nit. Let's get this in and do more testing on the live site.

Diff comments:

> === modified file 'wlhelp/management/commands/update_help.py'
> --- wlhelp/management/commands/update_help.py	2016-07-02 12:38:06 +0000
> +++ wlhelp/management/commands/update_help.py	2017-07-20 18:25:30 +0000
> @@ -209,6 +210,10 @@
>              element_set = {}
>              for element in json_:
>                  element_set[element['name']] = str(element['amount'])
> +            # Sort the dictionary alphabetical. Otherwise there will be made

alphabetically. Otherwise a wrong relation will be made

> +            # a wrong relation between e.g. build_cost and build_wares in 
> +            # models.get_build_cost() and other functions over there.
> +            element_set = collections.OrderedDict(sorted(element_set.items()))
>              counts = ' '.join(element_set.values())
>              objects = [objtype.objects.get_or_create(name=w, tribe=self._to)[
>                  0] for w in element_set.keys()]


-- 
https://code.launchpad.net/~widelands-dev/widelands-website/fix_wares_for_encyclopedia/+merge/327737
Your team Widelands Developers is subscribed to branch lp:widelands-website.


References