site name
This commit is contained in:
parent
c82d8c520b
commit
c7a83258a1
3 changed files with 19 additions and 25 deletions
|
|
@ -30,19 +30,17 @@ class TransactionSerializer(serializers.ModelSerializer):
|
|||
read_only_fields = ['uuid', 'last_update', 'state', 'create'] # , 'detail_id'] #, 'application_client_id']
|
||||
|
||||
def create(self, validated_data):
|
||||
# payer = validated_data.get('payer')
|
||||
# request = self.context.get('request')
|
||||
# user = request.user if request else payer
|
||||
|
||||
payer = validated_data.get('payer')
|
||||
request = self.context.get('request')
|
||||
user = request.user if request else payer
|
||||
|
||||
if user == payer:
|
||||
with atomic():
|
||||
# if user == payer:
|
||||
# with atomic():
|
||||
# transaction = Transaction.objects.create_transaction(**validated_data)
|
||||
# transaction.pay()
|
||||
#
|
||||
# else:
|
||||
transaction = Transaction.objects.create_transaction(**validated_data)
|
||||
transaction.pay()
|
||||
|
||||
else:
|
||||
transaction = Transaction.objects.create_transaction(**validated_data)
|
||||
|
||||
return transaction
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -52,14 +52,10 @@ urlpatterns = [
|
|||
url(r'^redoc/$', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'),
|
||||
path('admin/', admin.site.urls),
|
||||
# path('accounts/', include(auth_urls)),
|
||||
# path('login/', OTPLoginView.as_view(), name='login'),
|
||||
# path('logout/', LogoutView.as_view(), name='logout'),
|
||||
# path('', home, name='home'),
|
||||
|
||||
# path('oauth2/introspect', introspect_token),
|
||||
# path('oauth2/introspect/', introspect_token, name='introspect'),
|
||||
path('login/', OTPLoginView.as_view(), name='login'),
|
||||
path('logout/', LogoutView.as_view(), name='logout'),
|
||||
path('', home, name='home'),
|
||||
path('oauth2/', include('oauth2_provider.urls', namespace='oauth2_provider')),
|
||||
# url(r'^oauth2/register_scope/$', register_scope, name = 'register-scope'),
|
||||
|
||||
path('account/', AccountView.as_view(), name='account'),
|
||||
path('users/', UserListView.as_view()),
|
||||
|
|
@ -69,15 +65,15 @@ urlpatterns = [
|
|||
path('province', ProvinceApiView.as_view(), name='province'),
|
||||
path('inquiry/', UserInquiryView.as_view(), name='inquiry'),
|
||||
|
||||
# path('transactions/', TransactionList.as_view(), name='transactions'),
|
||||
path('transactions/', TransactionList.as_view(), name='transactions'),
|
||||
# path('transactions/<uuid>', TransactionDetail.as_view(), name='transaction_detail'),
|
||||
# path('transactions/<uuid>/pay', TransactionPay.as_view(), name='transaction_pay'),
|
||||
#
|
||||
# path('deposit/', DepositSubmit.as_view(), name='deposit_submit'),
|
||||
# path('deposit/<uuid>/verify', DepositVerify.as_view(), name='deposit_verify'),
|
||||
path('deposit/', DepositSubmit.as_view(), name='deposit_submit'),
|
||||
path('deposit/<uuid>/verify', DepositVerify.as_view(), name='deposit_verify'),
|
||||
#
|
||||
# path('withdraw/', WithdrawSubmit.as_view(), name='withdraw_submit'),
|
||||
# path('withdraw/<uuid>/verify', WithdrawVerify.as_view(), name='withdraw_verify'),
|
||||
path('withdraw/', WithdrawSubmit.as_view(), name='withdraw_submit'),
|
||||
path('withdraw/<uuid>/verify', WithdrawVerify.as_view(), name='withdraw_verify'),
|
||||
]
|
||||
|
||||
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{% with site_title="Gooyal Accounts" %}
|
||||
{% with site_title="Account Managment" %}
|
||||
<!DOCTYPE html>
|
||||
{% load static %}
|
||||
{# {% load jalali_tags %}#}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue