Exemple #1
0
    def post(self):
        self.check_xsrf_cookie()

        provider = self.get_session_object("provider")
        list_data = self.get_session_object("list")
        driver = self.get_session_object("driver")
        
        if not provider or not list_data:
            self.redirect("/api")
        elif not driver:
            self.redirect("/database")
        
        lists = setup_model.check_synced_list(list_data["id"])

        if not lists:
            columns = self._get_column_fields(list_data["fields"])

            detail = {
                "database": dict(driver),
                "provider": dict(provider),
                "list": dict(list_data),
                "last_synced": unix_utc_now(),
                "date_created": unix_utc_now(),
                "columns": columns
            }
            
            detail_id = Sync().create(detail)

        self.delete_session_object("list")
        self.delete_session_object("driver")
        self.delete_session_object("provider")

        self.redirect("/dashboard")
Exemple #2
0
	def update_status_completed(self, last_id, details_id):
		try:
			details_table.update_last_synced(details_id, unix_utc_now())
			
			lists_table.update_status_completed(details_id, last_id)

			return True
		except Exception, err:
			logging.error(err)
			return False