fix(pg): uncomment
uncomment
This commit is contained in:
parent
a032eb1ccd
commit
33a7ab386e
2 changed files with 40 additions and 40 deletions
|
|
@ -6,8 +6,8 @@ from .views import user as user_views
|
||||||
app_name = "wallet"
|
app_name = "wallet"
|
||||||
|
|
||||||
user_urlpatterns = [
|
user_urlpatterns = [
|
||||||
# path('transactions/', user_views.TransactionListView.as_view(), name='user_transaction_list_page'),
|
path('transactions/', user_views.TransactionListView.as_view(), name='user_transaction_list_page'),
|
||||||
# path('transactions/<pk>', user_views.TransactionDetailView.as_view(), name='user_transaction_detail_page'),
|
path('transactions/<pk>', user_views.TransactionDetailView.as_view(), name='user_transaction_detail_page'),
|
||||||
path('api/wallets/', user_views.WalletAccountListAPIView.as_view(), name='user_wallet_account_api'),
|
path('api/wallets/', user_views.WalletAccountListAPIView.as_view(), name='user_wallet_account_api'),
|
||||||
path('api/transactions/', user_views.TransactionListAPIView.as_view(), name='user_transaction_list_api'),
|
path('api/transactions/', user_views.TransactionListAPIView.as_view(), name='user_transaction_list_api'),
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,9 @@ from apps.wallet.serializers import TransactionSerializer, DepositSerializer, Wi
|
||||||
AccountSerializer
|
AccountSerializer
|
||||||
from ..constans import StateChoices, TypeChoices
|
from ..constans import StateChoices, TypeChoices
|
||||||
from ..filters import AccountFilter, UserTransactionFilter
|
from ..filters import AccountFilter, UserTransactionFilter
|
||||||
# from ..forms import TransactionActionForm
|
from ..forms import TransactionActionForm
|
||||||
|
|
||||||
# from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
def get_application(request):
|
def get_application(request):
|
||||||
|
|
@ -186,44 +186,44 @@ class WithdrawVerify(generics.RetrieveAPIView):
|
||||||
return Response(serializer.data)
|
return Response(serializer.data)
|
||||||
|
|
||||||
|
|
||||||
# @method_decorator(login_required, name='dispatch')
|
@method_decorator(login_required, name='dispatch')
|
||||||
# class TransactionListView(ListView):
|
class TransactionListView(ListView):
|
||||||
# model = Transaction
|
model = Transaction
|
||||||
# template_name = 'wallet/transaction_list.html'
|
template_name = 'wallet/transaction_list.html'
|
||||||
#
|
|
||||||
# def get_queryset(self):
|
def get_queryset(self):
|
||||||
# user = self.request.user
|
user = self.request.user
|
||||||
# qs = super().get_queryset()
|
qs = super().get_queryset()
|
||||||
# return qs.filter(Q(payee_id=user.pk) | Q(payer_id=user.pk)).all()
|
return qs.filter(Q(payee_id=user.pk) | Q(payer_id=user.pk)).all()
|
||||||
|
|
||||||
|
|
||||||
# @method_decorator(login_required, name='dispatch')
|
@method_decorator(login_required, name='dispatch')
|
||||||
# class TransactionDetailView(UpdateView):
|
class TransactionDetailView(UpdateView):
|
||||||
# model = Transaction
|
model = Transaction
|
||||||
# form_class = TransactionActionForm
|
form_class = TransactionActionForm
|
||||||
# template_name = 'wallet/transaction_detail.html'
|
template_name = 'wallet/transaction_detail.html'
|
||||||
#
|
|
||||||
# def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
# context_data = super().get_context_data(**kwargs)
|
context_data = super().get_context_data(**kwargs)
|
||||||
# context_data['StateChoices'] = StateChoices
|
context_data['StateChoices'] = StateChoices
|
||||||
# return context_data
|
return context_data
|
||||||
#
|
|
||||||
# def get_queryset(self):
|
def get_queryset(self):
|
||||||
# user = self.request.user
|
user = self.request.user
|
||||||
# return Transaction.objects.filter(Q(payee=user) | Q(payer=user) | Q(payer__isnull=True)).all()
|
return Transaction.objects.filter(Q(payee=user) | Q(payer=user) | Q(payer__isnull=True)).all()
|
||||||
#
|
|
||||||
# def get_success_url(self):
|
def get_success_url(self):
|
||||||
# return reverse('wallet:transaction_detail', kwargs={'pk': self.get_object().pk})
|
return reverse('wallet:transaction_detail', kwargs={'pk': self.get_object().pk})
|
||||||
#
|
|
||||||
# def form_valid(self, form):
|
def form_valid(self, form):
|
||||||
# transaction: Transaction = form.instance
|
transaction: Transaction = form.instance
|
||||||
# if 'pay' in self.request.POST:
|
if 'pay' in self.request.POST:
|
||||||
# result = transaction.pay(payer=self.request.user)
|
result = transaction.pay(payer=self.request.user)
|
||||||
# messages.error(self.request, _('success.'))
|
messages.error(self.request, _('success.'))
|
||||||
# if 'receipt' in self.request.POST:
|
if 'receipt' in self.request.POST:
|
||||||
# result = transaction.receipt()
|
result = transaction.receipt()
|
||||||
# messages.error(self.request, _('success.'))
|
messages.error(self.request, _('success.'))
|
||||||
# return super().form_valid(form)
|
return super().form_valid(form)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue