mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-31 10:31:35 +00:00
Fix bug for multiple order maker telegram enabling. Add TG to admin panel.
This commit is contained in:
parent
30e35f8973
commit
aa1994b1f1
@ -103,6 +103,7 @@ class UserProfileAdmin(AdminChangeLinksMixin, admin.ModelAdmin):
|
|||||||
"avatar_tag",
|
"avatar_tag",
|
||||||
"id",
|
"id",
|
||||||
"user_link",
|
"user_link",
|
||||||
|
"telegram_enabled",
|
||||||
"total_contracts",
|
"total_contracts",
|
||||||
"platform_rating",
|
"platform_rating",
|
||||||
"total_ratings",
|
"total_ratings",
|
||||||
|
@ -44,13 +44,15 @@ class Telegram():
|
|||||||
|
|
||||||
def welcome(self, user):
|
def welcome(self, user):
|
||||||
lang = user.profile.telegram_lang_code
|
lang = user.profile.telegram_lang_code
|
||||||
order = Order.objects.get(maker=user)
|
order = Order.objects.get(maker=user, status=Order.Status.PUB)
|
||||||
print(str(order.id))
|
print(str(order.id))
|
||||||
if lang == 'es':
|
if lang == 'es':
|
||||||
text = f'Hola {user.username}, te enviaré un mensaje cuando tu orden con ID {str(order.id)} haya sido tomada.'
|
text = f'Hola {user.username}, te enviaré un mensaje cuando tu orden con ID {str(order.id)} haya sido tomada.'
|
||||||
else:
|
else:
|
||||||
text = f"Hey {user.username}, I will send you a message when someone takes your order with ID {str(order.id)}."
|
text = f"Hey {user.username}, I will send you a message when someone takes your order with ID {str(order.id)}."
|
||||||
self.send_message(user, text)
|
self.send_message(user, text)
|
||||||
|
user.profile.telegram_welcomed = True
|
||||||
|
user.profile.save()
|
||||||
return
|
return
|
||||||
|
|
||||||
def order_taken(self, order):
|
def order_taken(self, order):
|
||||||
|
Loading…
Reference in New Issue
Block a user