mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-18 12:11: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",
|
||||
"id",
|
||||
"user_link",
|
||||
"telegram_enabled",
|
||||
"total_contracts",
|
||||
"platform_rating",
|
||||
"total_ratings",
|
||||
|
@ -44,13 +44,15 @@ class Telegram():
|
||||
|
||||
def welcome(self, user):
|
||||
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))
|
||||
if lang == 'es':
|
||||
text = f'Hola {user.username}, te enviaré un mensaje cuando tu orden con ID {str(order.id)} haya sido tomada.'
|
||||
else:
|
||||
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)
|
||||
user.profile.telegram_welcomed = True
|
||||
user.profile.save()
|
||||
return
|
||||
|
||||
def order_taken(self, order):
|
||||
|
Loading…
Reference in New Issue
Block a user