コード例 #1
0
ファイル: times.py プロジェクト: KenjiTakahashi/intranet
    def _send_email(self):
        data = self._get_data()
        data["not_full_time_users"] = self._get_not_full_time_employees()
        data["quarters"] = "Q%s" % idate.quarter_number(self.start), "Q%s" % idate.quarter_number(self.end)
        data["months"] = self.months
        response = render("intranet3:templates/_email_reports/missed_hours.html", data, request=self.request)
        response = response.replace("\n", "").replace("\t", "")
        deferred = EmailSender.send_html(config["MANAGER_EMAIL"], self._(u"[Intranet2] Missed hours"), response)

        def on_success(result):
            LOG(u"Report with missed hours - sent")

        def on_error(err):
            EXCEPTION(u"Failed to sent report with missed hours")

        deferred.addCallbacks(on_success, on_error)
        return data
コード例 #2
0
ファイル: times.py プロジェクト: woliveira0101/intranet-open
 def _send_email(self):
     data = self._get_data()
     data['not_full_time_users'] = self._get_not_full_time_employees()
     data['quarters'] = 'Q%s' % idate.quarter_number(
         self.start), 'Q%s' % idate.quarter_number(self.end)
     data['months'] = self.months
     response = render(
         'intranet3:templates/_email_reports/missed_hours.html',
         data,
         request=self.request)
     response = response.replace('\n', '').replace('\t', '')
     with mail.EmailSender as email_sender:
         email_sender.send(
             config['MANAGER_EMAIL'],
             self._(u'[Intranet2] Missed hours'),
             html_message=response,
         )
     return data
コード例 #3
0
ファイル: times.py プロジェクト: Rhenan/intranet-open
 def _send_email(self):
     data = self._get_data()
     data['not_full_time_users'] = self._get_not_full_time_employees()
     data['quarters'] = 'Q%s' % idate.quarter_number(self.start), 'Q%s' % idate.quarter_number(self.end)
     data['months'] = self.months
     response = render(
         'intranet3:templates/_email_reports/missed_hours.html',
         data,
         request=self.request
     )
     response = response.replace('\n', '').replace('\t', '')
     with mail.EmailSender as email_sender:
         email_sender.send(
             config['MANAGER_EMAIL'],
             self._(u'[Intranet2] Missed hours'),
             html_message=response,
         )
     return data
コード例 #4
0
ファイル: times.py プロジェクト: pytlakp/intranet-1
 def _send_email(self):
     data = self._get_data()
     data['not_full_time_users'] = self._get_not_full_time_employees()
     data['quarters'] = 'Q%s' % idate.quarter_number(self.start), 'Q%s' % idate.quarter_number(self.end)
     data['months'] = self.months
     response = render(
         'intranet3:templates/_email_reports/missed_hours.html',
         data,
         request=self.request
     )
     response = response.replace('\n', '').replace('\t', '')
     deferred = EmailSender.send_html(
         config['MANAGER_EMAIL'],
         self._(u'[Intranet2] Missed hours'),
         response
     )
     def on_success(result):
         LOG(u'Report with missed hours - sent')
     def on_error(err):
         EXCEPTION(u'Failed to sent report with missed hours')
     deferred.addCallbacks(on_success, on_error)
     return data
コード例 #5
0
ファイル: times.py プロジェクト: adamgr/intranet
 def _send_email(self):
     data = self._get_data()
     data['not_full_time_users'] = self._get_not_full_time_employees()
     data['quarters'] = 'Q%s' % idate.quarter_number(self.start), 'Q%s' % idate.quarter_number(self.end)
     data['months'] = self.months
     response = render(
         'intranet3:templates/_email_reports/missed_hours.html',
         data,
         request=self.request
     )
     response = response.replace('\n', '').replace('\t', '')
     deferred = EmailSender.send_html(
         config['MANAGER_EMAIL'],
         self._(u'[Intranet2] Missed hours'),
         response
     )
     def on_success(result):
         LOG(u'Report with missed hours - sent')
     def on_error(err):
         EXCEPTION(u'Failed to sent report with missed hours')
     deferred.addCallbacks(on_success, on_error)
     return data
コード例 #6
0
ファイル: test_idate.py プロジェクト: Rhenan/intranet-open
 def test_quarter(self):
     months = [datetime.date(2013, x, 1) for x in range(1, 13)]
     quarters = [idate.quarter_number(date) for date in months]
     self.assertEqual(quarters, [1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4])
コード例 #7
0
 def test_quarter(self):
     months = [datetime.date(2013, x, 1) for x in range(1, 13)]
     quarters = [idate.quarter_number(date) for date in months]
     self.assertEqual(quarters, [1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4])