@@ -75,14 +75,15 @@ def get_update(self):
75
75
"""
76
76
77
77
sql = """
78
- SELECT p.persona_id, a.id, a.slug,
78
+ SELECT p.persona_id, a.id, a.slug, v.version,
79
79
t_name.localized_string AS name,
80
80
t_desc.localized_string AS description,
81
81
p.display_username, p.header,
82
82
p.footer, p.accentcolor, p.textcolor,
83
83
UNIX_TIMESTAMP(a.modified) AS modified
84
84
FROM addons AS a
85
85
LEFT JOIN personas AS p ON p.addon_id=a.id
86
+ LEFT JOIN versions AS v ON a.current_version=v.id
86
87
LEFT JOIN translations AS t_name
87
88
ON t_name.id=a.name AND t_name.locale=%(locale)s
88
89
LEFT JOIN translations AS t_desc
@@ -95,9 +96,9 @@ def get_update(self):
95
96
row = self .cursor .fetchone ()
96
97
97
98
row_to_dict = lambda row : dict (zip ((
98
- 'persona_id' , 'addon_id' , 'slug' , 'name ' , 'description ' ,
99
- 'username ' , 'header ' , 'footer ' , 'accentcolor ' , 'textcolor ' ,
100
- 'modified' ),
99
+ 'persona_id' , 'addon_id' , 'slug' , 'current_version ' , 'name ' ,
100
+ 'description ' , 'username ' , 'header ' , 'footer ' , 'accentcolor ' ,
101
+ 'textcolor' , ' modified' ),
101
102
list (row )))
102
103
103
104
if row :
@@ -147,9 +148,8 @@ def get_json(self):
147
148
'textcolor' : '#%s' % text if text else None ,
148
149
'updateURL' : self .locale_url (settings .VAMO_URL ,
149
150
'/themes/update-check/' + id_ ),
150
- # TODO: Change this when we add versions (bug 851881).
151
151
# 04-25-2013: Bumped for GP migration so we get new `updateURL`s.
152
- 'version' : '1.1'
152
+ 'version' : row . get ( 'current_version' , 0 )
153
153
}
154
154
155
155
# If this theme was originally installed from getpersonas.com,
0 commit comments