Use default version from product_details and always have product_details #36

Closed
wants to merge 4 commits into
from

Conversation

Projects
None yet
3 participants

No description provided.

apps/input/__init__.py
@@ -78,7 +78,8 @@ class FIREFOX:
pretty = _(u'Firefox')
guid = '{ec8030f7-c20a-464f-9b0e-13a3a9e97384}'
extra_versions = ['10.0a1', '9.0a2', '8.0', '7.0']
- default_version = '7.0' # Default dashboard version.
+ default_version = version_list(product_details. \
@davedash

davedash Nov 10, 2011

Member

you could do the newline after the open parenthesis, then indent 8 spaces:

When using a hanging indent the following
considerations should be applied; there should be no arguments on the
first line and further indentation should be used to clearly distinguish
itself as a continuation line.


The preferred way of wrapping long lines is by using Python's implied line
continuation inside parentheses, brackets and braces.  Long lines can be
broken over multiple lines by wrapping expressions in parentheses. These
should be used in preference to using a backslash for line continuation.
Make sure to indent the continued line appropriately.  The preferred place
to break around a binary operator is *after* the operator, not before it.
apps/search/views.py
@@ -207,7 +207,11 @@ def index(request):
[(v.version, v.version) for v in VERSIONS
if v.product == MOBILE.id]),
}
-
+ if (FIREFOX.default_version, FIREFOX.default_version) not in VERSION_CHOICES[FIREFOX]:
@davedash

davedash Nov 10, 2011

Member

Add this to Version_Choices and then do something like list(set(versions+default))) to get a deduped set.

Okay, so how we are doing this sucks. We have a form in form.py, but we don't use that to display the form. But we use that data when we want to check what version is currently displayed (See line 236 in search/view.py). I've fixed it, but I'm not happy with the fix.

Member

davedash commented Nov 14, 2011

looks a lot better, is it testable?

The test doesn't actually work. It throws up http://nigelb.pastebin.mozilla.org/1405518

Member

mythmon commented Nov 21, 2012

Failing tests ▶️ closed.

@mythmon mythmon closed this Nov 21, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment