From 11acfc621c3dcfe171bf6508d8c21c5f861a6e6a Mon Sep 17 00:00:00 2001 From: Amanda Cruz Lima Date: Thu, 12 Dec 2024 17:12:40 -0300 Subject: [PATCH] resolvendo o problema do modal --- .../__pycache__/__init__.cpython-312.pyc | Bin 181 -> 170 bytes .../Users/__pycache__/admin.cpython-312.pyc | Bin 2449 -> 2444 bytes .../Users/__pycache__/apps.cpython-312.pyc | Bin 485 -> 474 bytes .../Users/__pycache__/forms.cpython-312.pyc | Bin 1993 -> 1982 bytes .../Users/__pycache__/models.cpython-312.pyc | Bin 1851 -> 1840 bytes .../Users/__pycache__/views.cpython-312.pyc | Bin 4584 -> 4524 bytes mamutes/Users/static/scripts/openModal.js | 25 ++++++++++++++++-- mamutes/Users/templates/recoverAccount.html | 6 ++--- mamutes/Users/views.py | 25 ++++++++---------- mamutes/db.sqlite3 | Bin 176128 -> 176128 bytes mamutes/mamutes/urls.py | 6 ++--- 11 files changed, 39 insertions(+), 23 deletions(-) diff --git a/mamutes/Users/__pycache__/__init__.cpython-312.pyc b/mamutes/Users/__pycache__/__init__.cpython-312.pyc index a69dd068b058145b77776a2a5028aee65da68d90..df16278e01d5ce837f8b55f13aec669b681d2b1c 100644 GIT binary patch delta 98 zcmdnWxQdbcG%qg~0}!mViJHi5?Ct4n6%$&VT2vg9n46fF662qj>QasXYTS{##`m|I!`q#>H(<1_OzOXB183My|+oT3N-6dxjK delta 109 zcmZ3*xRsInG%qg~0}ymgigyUD66C7y>k_PAP?VpgZ)9L(qGzP*Sd^Jste=~hTUr97LyJ?3iuL2;GxIV_;^XxS KDt}GvR0IG>=_GOh diff --git a/mamutes/Users/__pycache__/admin.cpython-312.pyc b/mamutes/Users/__pycache__/admin.cpython-312.pyc index 65e18ac083d326c3390fa4ba14f02709416e0f56..39e0a0e60588eeefc0ed54ef10d181510a299dbc 100644 GIT binary patch delta 147 zcmbOz+#}3;nwOW00SH#wM5UkK$lJth@8)b36Iz^FR2-9-o0yjptC?&ytw%TDlz#qaFv mH~9do82@Dp&ufxiE7E4D&DWo;e`)h;Rz_yVUz6W*%m)CNt1kHf diff --git a/mamutes/Users/__pycache__/apps.cpython-312.pyc b/mamutes/Users/__pycache__/apps.cpython-312.pyc index ff50487664e714875c09f80dac8bce51eaf2cc8b..b6e35df2679d81f599c5c8b5a42c7ce71cc6fb96 100644 GIT binary patch delta 96 zcmaFLe2ba)G%qg~0}!mViAtZek(Zg#-qqPECbT%Us5mAuH!&|I#y>CBr6{v3HO3`B tximL5uOz=X#>l|PM9)aqu_!aOI3_nSx3mOELo`i}VvJ(EHF+ze0RZ8PAm9K1 delta 107 zcmcb`{FIsZG%qg~0}ymgi%9R?$ji*=6`-GypPQlz#qCBr6{v3HO3`B uximL5uOz=X#>l|PM9)aqu_!aOI3_nSx3mOELo{uUVOC;cyfwL=-3tKy0U)^m delta 108 zcmdnTf0Cc~G%qg~0}ymgi%9R>$ji#?6{w$)pPQlz#qlz#qGWM&KRu18k`cqHmOoN|D0$cp@nFj zH$+8j@)=z+WJPXbRu39&N?Q|i`UxYXgfI@Q1BFw0EW-rQXf3=0-C95#sKPqfX<`7B zh$>=AyDDMXu_`Bmm7gcOhz37t+exZ|Is8DI19$yiV#((axgdH(^^CN6sYkj*+F{Rf2j`HF zfl51mESYW6j(D+L#|9O;wE%b79si*Z4~cUi<^{HWDz6G#M2WJa9^aw7`>z94RHgsL zS3yF)YPw}qOY|8C8|W$X0HxX4$c+TiVDLDs?1E-AXsb9suUQtVuqru`5X}(!%VtQ^ zZ6i{+B+Hnsk)wxPZ)_O5`|-BI`0K2JIxXHS-zjfKKG5+x`o_JPl0keL)~09Qt<>hM zTFkCThj@STPYB4d&B>2ae~sxsU_rbL>(Op6$Q=)!159`Id*BHHQ)pehB&6_- z3Et$fG6&ITaSr>3q$}hoc8pca5(Qx=x+^CMlR|s)i}P-krW{{WH?*0KNq delta 1044 zcmaJ=O=#3W6rM>o+3Zh}-R{h z6$C{*D02}-FJ3IIdgwtff=5AwptnWQn|hIog6PSav{CWkgM9CsdEXn}yf>NY{@5+Q zkmWd__Wj!7@eeoTCGgpezRpPq3}EmkusEFyc*GPeQ5OR)m{Cj8B`c=K=~^_RX5s-; zF_v6ll9{k%T@LgyQ?XQC4S3v4S!q2T@Pyf9W%LZ?$xA?w88XEz2at#kWv3x43IId7 z1g7UH(3=gFN){O@iY;f;xu#DnlH(c@Mn)N1-R^$sOIV9k(r{m5OD%-;ut+V0EIl}=U@l9A1QKJB(l&0yGTJOz|Z6n zJh{x3SjEgLLD%Pbh!vUmVm3Jw32$FfNlI?*!WZ3is0o`<=l(v6e1^S~9-I-v%sTIJ zl}woQ$9w#5Ma1JP**}qx)djaD&3!c0arOEg->oYYv z)r67sAWf6+@MTyRU4A|SfCmiD6Q>u}qfDv%Uy)PyVAg_j89HVA6vCTJC3~Xk=8wCU z*$|LbESqfRvwNeR5dI{#bT!_PEL3%h{ modal.showModal(); }); btnClose.addEventListener("click", ()=>{ modal.close(); - }) -})() \ No newline at end of file + }); + + form.addEventListener("submit", (event) => { + event.preventDefault(); + const formData = new FormData(form); + fetch(form.action, { + method: 'POST', + body: formData, + headers: { + 'X-Requested-With': 'XMLHttpRequest', + }, + }) + .then(response => response.json()) + .then(data => { + mensagemContainer.textContent = data.mensagem; + if (data.success) { + form.reset(); + } + }) + }); +})(); \ No newline at end of file diff --git a/mamutes/Users/templates/recoverAccount.html b/mamutes/Users/templates/recoverAccount.html index 29f7b73..22f2491 100644 --- a/mamutes/Users/templates/recoverAccount.html +++ b/mamutes/Users/templates/recoverAccount.html @@ -14,15 +14,13 @@

Recuperar Conta

Preencha o formulário

-
+

Email

{% csrf_token %} - {% if mensagem %} - {{ mensagem }} - {% endif%}
+