From bd2c214273bfb12ccf01b32b202fbbfd21367e4a Mon Sep 17 00:00:00 2001 From: fjrodriguez Date: Thu, 22 Dec 2022 14:08:17 -0600 Subject: [PATCH] minimal changes --- Admin/settings.py | 28 +++++++++++++--------------- Admin/urls.py | 9 +-------- Clientes/urls.py | 2 +- Clientes/views.py | 4 ++-- Templates/Clientes/index.html | 3 +++ Templates/partials/search_form.html | 4 ++-- 6 files changed, 22 insertions(+), 28 deletions(-) diff --git a/Admin/settings.py b/Admin/settings.py index d3f2f9f..a49b867 100644 --- a/Admin/settings.py +++ b/Admin/settings.py @@ -15,7 +15,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent SECRET_KEY = os.getenv("adminAS_KEY") # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = False +DEBUG = True ALLOWED_HOSTS = ['*'] # Application definition @@ -34,7 +34,7 @@ INSTALLED_APPS = [ 'allauth.account', 'allauth.socialaccount', 'widget_tweaks', - 'Admin', + 'Clientes', ] REST_FRAMEWORK = { @@ -99,27 +99,25 @@ ACCOUNT_SIGNUP_REDIRECT_URL =LOGIN_REDIRECT_URL ACCOUNT_LOGOUT_ON_PASSWORD_CHANGE = True -if DEBUG: - EMAIL_TIMEOUT = 10 - EMAIL_USE_TLS = True - EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' +EMAIL_TIMEOUT = 10 +EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' +EMAIL_SUBJECT_PREFIX = 'AS Timbres' +if DEBUG: + EMAIL_USE_TLS = True EMAIL_HOST = 'smtp.gmail.com' EMAIL_PORT = 587 EMAIL_HOST_USER = 'aduanasoftpruebas@gmail.com' - EMAIL_HOST_PASSWORD = 'zsgtbxsuwyacyhqq' - EMAIL_SUBJECT_PREFIX = 'AS Timbres' - #EMAIL_USE_SSL=True -else: - EMAIL_TIMEOUT = 10 - EMAIL_USE_TLS = False - EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' + EMAIL_HOST_PASSWORD = os.getenv("test_pwd_email") + #EMAIL_USE_SSL=False +else: + EMAIL_USE_TLS = False EMAIL_HOST = 'secure.emailsrvr.com' EMAIL_PORT = 465 EMAIL_HOST_USER = 'noreply@aduanasoft.com.mx' - EMAIL_HOST_PASSWORD = 'N036p7y!' - EMAIL_SUBJECT_PREFIX = 'AS Timbres' + EMAIL_HOST_PASSWORD = os.getenv("pwd_email") EMAIL_USE_SSL=True + # Database # https://docs.djangoproject.com/en/4.1/ref/settings/#databases diff --git a/Admin/urls.py b/Admin/urls.py index 184a42e..3da3cf4 100644 --- a/Admin/urls.py +++ b/Admin/urls.py @@ -13,29 +13,22 @@ def response_error_handler(request, exception=None): context={} return render(request, '403.html',context,status=403) - def permission_denied_view(request): raise PermissionDenied - - urlpatterns = [ path('admin/', admin.site.urls), - path('accounts/', include('allauth.urls')), + path('accounts/', include('allauth.urls')), path('DRF_Token/', obtain_auth_token, name='DRF_Token'), path('', include('Clientes.urls')), path('403/', permission_denied_view), ] handler403 = response_error_handler - - if settings.DEBUG: #DEV only urlpatterns += static(settings.STATIC_URL, document_root= settings.STATIC_ROOT) urlpatterns += static(settings.MEDIA_URL, document_root= settings.MEDIA_ROOT) - - # ROOT_URLCONF must specify the module that contains handler403 = ... @override_settings(ROOT_URLCONF=__name__) class CustomErrorHandlerTests(SimpleTestCase): diff --git a/Clientes/urls.py b/Clientes/urls.py index b65b39d..80c20f8 100644 --- a/Clientes/urls.py +++ b/Clientes/urls.py @@ -18,7 +18,7 @@ from .views import ( ) urlpatterns = [ - path('', index, name='index'), + path('', index, name='index'), path('add_timbre2/', add_timbre2.as_view(), name='add_timbre2'), path('timbres_cliente//', timbres_cliente, name='timbres_cliente'), path('cliente/update//',ClientesUpdateView.as_view(),name='update_cliente'), diff --git a/Clientes/views.py b/Clientes/views.py index 5a065b4..e5f07fa 100644 --- a/Clientes/views.py +++ b/Clientes/views.py @@ -174,8 +174,8 @@ def index(request): filters.pop('datepicker','') filters.pop('datepickerFin','') filters.pop('mes','') - #print('filters------',filters) - if rfcc: + print('filters------',filters) + if rfcc and search: clientes_list = Clientes.objects.filter(Q(RFC__icontains=search)) # for i,ii in enumerate(clientes_list): diff --git a/Templates/Clientes/index.html b/Templates/Clientes/index.html index dd511b6..54dea59 100644 --- a/Templates/Clientes/index.html +++ b/Templates/Clientes/index.html @@ -303,7 +303,10 @@ Timbres disponibles Comercio Digital: {{saldo}} table_rfcc.addEventListener('click',(event)=>{ document.getElementById('rfcc').checked= table_rfcc.checked? true:false; + }) + + window.addEventListener("load", (event)=>{ let mes ='{{mes}}' diff --git a/Templates/partials/search_form.html b/Templates/partials/search_form.html index 3d1a3c0..717ccfa 100644 --- a/Templates/partials/search_form.html +++ b/Templates/partials/search_form.html @@ -2,7 +2,7 @@ Fecha: {{fecha|date:"d F Y"}} -
+ @@ -29,5 +29,5 @@ });*/ - +
\ No newline at end of file