def redirect(self):
     flow = models.ReleaseStream.objects.get(id=self.flow)
     project = flow.project
     if self.hasProjectPermission(project):
         tasks.pushRelease(self.build, flow)
         
     return redirect('projects_deploy_view', id=project.id)
    def formSubmited(self, form):
        flow = models.ReleaseStream.objects.get(id=self.flow)
        release = form.cleaned_data

        schedule = release['scheduled'] + timedelta(hours=int(release['tz']))

        tasks.pushRelease(self.build, flow, scheduled=schedule)
        
        return redirect('projects_deploy_view', id=flow.project.id)