Пример #1
0
 def confirm_reservations(self, token=None):
     # Remove session_id from all reservations in the current session.
     db.confirm_reservations_for_session(
         plone_session.get_session_id(self.context),
         token,
         utils.get_current_language(self.context, self.request)
     )
Пример #2
0
    def use_translated_emails_as_default(self):
        language = utils.get_current_language(self.context, self.request)[:2]

        subjects = self.get_field_map('_subject')
        contents = self.get_field_map('_content')

        self.apply_field_map(subjects,
                             lambda tpl: templates[tpl].get_subject(language))
        self.apply_field_map(contents,
                             lambda tpl: templates[tpl].get_body(language))
Пример #3
0
    def use_translated_emails_as_default(self):
        language = utils.get_current_language(self.context, self.request)[:2]

        subjects = self.get_field_map('_subject')
        contents = self.get_field_map('_content')

        self.apply_field_map(
            subjects, lambda tpl: templates[tpl].get_subject(language)
        )
        self.apply_field_map(
            contents, lambda tpl: templates[tpl].get_body(language)
        )
Пример #4
0
 def scheduler(self):
     """ Returns the scheduler of the resource. """
     language = utils.get_current_language(self.context, self.request)
     return self.context.scheduler(language=language)
Пример #5
0
 def scheduler(self):
     """ Returns the scheduler of the resource. """
     language = utils.get_current_language(self.context, self.request)
     return self.context.scheduler(language=language)