Example #1
0
def _submit_finish(form, *args, **kwargs):
    if form.is_valid():
        video = form.save()
        submit_finished.send(sender=video)

        #redirect to a thank you page
        return HttpResponseRedirect(reverse('localtv_submit_thanks',
                                            args=[video.pk]))

    else:
        return render_to_response(*args, **kwargs)
Example #2
0
 def form_valid(self, form):
     response = super(SubmitVideoView, self).form_valid(form)
     identifiers = Q()
     if self.object.website_url:
         identifiers |= Q(website_url=self.object.website_url)
     if self.object.file_url:
         identifiers |= Q(file_url=self.object.file_url)
     if self.object.guid:
         identifiers |= Q(guid=self.object.guid)
     Video.objects.filter(identifiers, site=Site.objects.get_current(),
                          status=Video.REJECTED).delete()
     del self.request.session[self.get_session_key()]
     submit_finished.send(sender=self.object)
     return response