示例#1
0
    def form_valid(self):
        download = DownloadBase()
        res = prime_restore.delay(
            self.domain,
            CommCareUser.ids_by_domain(self.domain),
            version=V2,
            cache_timeout_hours=24,
            overwrite_cache=True,
            check_cache_only=False
        )
        download.set_task(res)

        return redirect('hq_soil_download', self.domain, download.download_id)
示例#2
0
    def form_valid(self, form):
        domain = form.cleaned_data['domain']
        if form.cleaned_data['all_users']:
            user_ids = CommCareUser.ids_by_domain(domain)
        else:
            user_ids = form.user_ids

        download = DownloadBase()
        res = prime_restore.delay(
            user_ids,
            version=form.cleaned_data['version'],
            cache_timeout=form.cleaned_data['cache_timeout'],
            overwrite_cache=form.cleaned_data['overwrite_cache']
        )
        download.set_task(res)

        return redirect('hq_soil_download', domain, download.download_id)
示例#3
0
    def form_valid(self):
        if self.form.cleaned_data['all_users']:
            user_ids = CommCareUser.ids_by_domain(self.domain)
        else:
            user_ids = self.form.user_ids

        download = DownloadBase()
        res = prime_restore.delay(
            self.domain,
            user_ids,
            version=V2,
            cache_timeout_hours=24,
            overwrite_cache=self.form.cleaned_data['overwrite_cache'],
            check_cache_only=self.form.cleaned_data['check_cache_only']
        )
        download.set_task(res)

        return redirect('hq_soil_download', self.domain, download.download_id)
示例#4
0
    def form_valid(self):
        if self.form.cleaned_data['all_users']:
            user_ids = CommCareUser.ids_by_domain(self.domain)
        else:
            user_ids = self.form.user_ids

        download = DownloadBase()
        res = prime_restore.delay(
            self.domain,
            user_ids,
            version=V2,
            cache_timeout_hours=24,
            overwrite_cache=self.form.cleaned_data['overwrite_cache'],
            check_cache_only=self.form.cleaned_data['check_cache_only']
        )
        download.set_task(res)

        return redirect('hq_soil_download', self.domain, download.download_id)