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, }
def dispatch(self, request, *args, **kwargs): return HttpResponse(SiteSettings.robots_get(), mimetype='text/plain')
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)
def handle_invitation_description(message): bot.send_message(message.chat.id, SiteSettings.get_invitation_description()) show_start_menu(message.chat.id)