def refresh_iarc_ratings(ids, **kw): """ Refresh old or corrupt IARC ratings by re-fetching the certificate. """ for app in Webapp.objects.filter(id__in=ids): data = iarc_get_app_info(app) if data.get('rows'): row = data['rows'][0] # We found a rating, so store the id and code for future use. app.set_descriptors(row.get('descriptors', [])) app.set_interactives(row.get('interactives', [])) app.set_content_ratings(row.get('ratings', {}))
def refresh_iarc_ratings(ids, **kw): """ Refresh old or corrupt IARC ratings. The caller is responsible for sending app ids that already have iarc information set. """ if waffle.switch_is_active('iarc-upgrade-v2'): for app in Webapp.objects.filter(id__in=ids): iarc_refresh(app) else: for app in Webapp.objects.filter(id__in=ids): data = iarc_get_app_info(app) if data.get('rows'): row = data['rows'][0] # We found a rating, so store the id and code for future use. app.set_descriptors(row.get('descriptors', [])) app.set_interactives(row.get('interactives', [])) app.set_content_ratings(row.get('ratings', {}))