Example #1
0
 def sent_view(self):
     model = self.get_one(request.args.get('id', None))
     if model is None or model.sent:
         return redirect(self.get_url('.index_view'))
     from scheduler import send_to_phantom_of_the_capitol
     send_to_phantom_of_the_capitol.delay(msgleg_id=model.id)
     flash('Message %s will attempt to be resent' % str(model.id))
     return redirect(self.get_url('.index_view'))
Example #2
0
 def queue_to_send(self, moc=None):
     from scheduler import send_to_phantom_of_the_capitol
     set_attributes(self, {'status': None}.iteritems(), commit=True)
     if moc is not None: self.set_legislators(moc)
     send_to_phantom_of_the_capitol.delay(self.id)
     return True