add notification for expence create api
This commit is contained in:
@@ -70,9 +70,7 @@ class ExpenceCreateSerializer(serializers.ModelSerializer):
|
|||||||
expence.counterparty.debit_usd += validated_data.get('price')
|
expence.counterparty.debit_usd += validated_data.get('price')
|
||||||
expence.counterparty.total_debit += expence.price
|
expence.counterparty.total_debit += expence.price
|
||||||
expence.counterparty.save()
|
expence.counterparty.save()
|
||||||
body = f"""
|
body = f"""{user.full_name} {expence.price} {expence.currency.upper()}... \n screen: /monitoring"""
|
||||||
{user.full_name} {expence.price} {expence.currency.upper()}... \n screen: /monitoring
|
|
||||||
"""
|
|
||||||
notify_user(user=user, title="Tasdiqlang yoki rad eting", body=body)
|
notify_user(user=user, title="Tasdiqlang yoki rad eting", body=body)
|
||||||
cash_transaction.save()
|
cash_transaction.save()
|
||||||
payment_type.save()
|
payment_type.save()
|
||||||
|
|||||||
1
core/apps/notifications/admin/__init__.py
Normal file
1
core/apps/notifications/admin/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
from .notification import *
|
||||||
5
core/apps/notifications/admin/notification.py
Normal file
5
core/apps/notifications/admin/notification.py
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
from django.contrib import admin
|
||||||
|
|
||||||
|
from core.apps.notifications.models import Notification
|
||||||
|
|
||||||
|
admin.site.register(Notification)
|
||||||
@@ -4,3 +4,6 @@ from django.apps import AppConfig
|
|||||||
class NotificationsConfig(AppConfig):
|
class NotificationsConfig(AppConfig):
|
||||||
default_auto_field = 'django.db.models.BigAutoField'
|
default_auto_field = 'django.db.models.BigAutoField'
|
||||||
name = 'core.apps.notifications'
|
name = 'core.apps.notifications'
|
||||||
|
|
||||||
|
def ready(self):
|
||||||
|
import core.apps.notifications.admin
|
||||||
Reference in New Issue
Block a user