Exemple #1
0
 def on_match(match):
     """Open the confirmation page"""
     portal_task.delay(
         self.portal.pk,
         'confirm_account_task',
         [comm.pk, match.group('link')],
     )
Exemple #2
0
    def send_msg(self, comm, **kwargs):
        """Send a message to the NextRequest portal"""
        # need to update communications to ensure we have the correct count
        # for figuring out if this is a new or update message
        comm.foia.communications.update()
        category, extra = comm.foia.process_manual_send(**kwargs)

        if category == 'n':
            portal_task.delay(
                self.portal.pk,
                'send_new_msg_task',
                [comm.pk],
                kwargs,
            )
        elif category in ('f', 'u'):
            portal_task.delay(
                self.portal.pk,
                'send_followup_msg_task',
                [comm.pk],
                kwargs,
            )
        elif category == 'p':
            # Payments are still always mailed
            SnailMailTask.objects.create(category=category,
                                         communication=comm,
                                         user=comm.from_user,
                                         **extra)
        else:
            super(NextRequestPortal,
                  self).send_msg(comm,
                                 reason='Unknown category of send message',
                                 **kwargs)
Exemple #3
0
 def document_reply(self, comm):
     """Process incoming documents"""
     p_file_available = re.compile(
         r"There are eFOIA files available for you to download")
     match = p_file_available.search(comm.communication)
     if match:
         portal_task.delay(self.portal.pk, "document_reply_task", [comm.pk])
     else:
         ManualPortal.receive_msg(self,
                                  comm,
                                  reason="Unexpected email format")
Exemple #4
0
 def on_match(match):
     """Download the files"""
     if comm.foia.current_tracking_id() != match.group("tracking_id"):
         ManualPortal.receive_msg(self,
                                  comm,
                                  reason="Tracking ID does not match")
     portal_task.delay(
         self.portal.pk,
         "document_reply_task",
         [comm.pk,
          match.group("documents"),
          match.group("text")],
     )
Exemple #5
0
 def on_match(match):
     """Download the files"""
     if comm.foia.current_tracking_id() != match.group('tracking_id'):
         ManualPortal.receive_msg(
             self,
             comm,
             reason='Tracking ID does not match',
         )
     portal_task.delay(
         self.portal.pk,
         'document_reply_task',
         [
             comm.pk,
             match.group('documents'),
             match.group('text'),
         ],
     )
Exemple #6
0
    def send_msg(self, comm, **kwargs):
        """Send a message to the NextRequest portal"""
        # need to update communications to ensure we have the correct count
        # for figuring out if this is a new or update message
        comm.foia.communications.update()
        category, extra = comm.foia.process_manual_send(**kwargs)

        if category == "n":
            portal_task.delay(self.portal.pk, "send_new_msg_task", [comm.pk],
                              kwargs)
        elif category in ("f", "u"):
            portal_task.delay(self.portal.pk, "send_followup_msg_task",
                              [comm.pk], kwargs)
        elif category == "p":
            # Payments are still always mailed
            prepare_snail_mail.delay(comm.pk, category, False, extra)
        else:
            super(NextRequestPortal,
                  self).send_msg(comm,
                                 reason="Unknown category of send message",
                                 **kwargs)
Exemple #7
0
 def on_match(match):
     """Open the confirmation page"""
     portal_task.delay(self.portal.pk, "confirm_account_task",
                       [comm.pk, match.group("link")])