Exemple #1
0
def send_user_details_to_admin(user_details):
    admin_chat_id = AdminContact.get_admin_chat_id(
        SiteSettings.get_settings().admin_tm)
    if admin_chat_id:
        bot.send_message(admin_chat_id, str(user_details))

    admin_email = SiteSettings.get_settings().admin_email
    if admin_email:
        send_email(admin_email, str(user_details))
    def post(self):
        form = SiteContactsForm(self.request.POST)
        success = False

        if form.validate():
            SiteSettings.batch_set(form.data)
            success = True

        return {
            "admin_section": "admin-contacts",
            "success": success,
            "form": form,
        }
    def get(self):
        settings = dict([(setting.key().name(), setting.value) for setting in SiteSettings.all().fetch(None)])
        form = SiteContactsForm(**settings)

        return {
            "admin_section": "admin-contacts",
            "form": form,
        }
Exemple #4
0
 def dispatch(self, request, *args, **kwargs):
     return HttpResponse(SiteSettings.robots_get(), mimetype='text/plain')
Exemple #5
0
 def dispatch(self, request, *args, **kwargs):
     return HttpResponse(SiteSettings.robots_get(), mimetype='text/plain')
Exemple #6
0
def show_order_description(message):
    StepModel.set_chat_step(chat_id=message.chat.id, step=const.Steps.order)
    bot.send_message(message.chat.id,
                     SiteSettings.get_order_description(),
                     reply_markup=order_keyboard)
Exemple #7
0
def handle_invitation_description(message):
    bot.send_message(message.chat.id,
                     SiteSettings.get_invitation_description())
    show_start_menu(message.chat.id)