def run(self): for schema in self.schemata: self.objects[schema["model"]] = self.process_schema(schema) if not OrderStatus.objects.exists(): print_("Creating order statuses...", end=" ") create_default_order_statuses() print_("done.") if not settings.DEBUG and is_telemetry_enabled(): try: data = json.dumps({"key": get_installation_key()}) resp = requests.get(url=settings.SHUUP_SUPPORT_ID_URL, data=data, timeout=5) if resp.json().get("support_id"): configuration.set(None, "shuup_support_id", resp.json().get("support_id")) except Exception: print_("Failed to get support id") print_("Initialization done.")
def run(self): for schema in self.schemata: self.objects[schema["model"]] = self.process_schema(schema) # Ensure default statuses are available print_("Creating order statuses...", end=" ") create_default_order_statuses() print_("done.") if not settings.DEBUG and is_telemetry_enabled(): try: data = json.dumps({ "key": get_installation_key() }) resp = requests.get(url=settings.SHUUP_SUPPORT_ID_URL, data=data, timeout=5) if resp.json().get("support_id"): configuration.set(None, "shuup_support_id", resp.json().get("support_id")) except Exception: print_("Failed to get support id") print_("Initialization done.")
def _backdate_installation_key(days=24): get_installation_key() PersistentCacheEntry.objects.filter(**INSTALLATION_KEY_KWARGS).update( time=now() - datetime.timedelta(days=days))
def _backdate_installation_key(days=24): get_installation_key() PersistentCacheEntry.objects.filter(**INSTALLATION_KEY_KWARGS).update(time=now() - datetime.timedelta(days=days))