public inbox for yew-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Shannon Sterz <s.sterz@proxmox.com>
To: yew-devel@lists.proxmox.com
Subject: [yew-devel] [PATCH yew-comp] user panel: don't submit raw "expire" field
Date: Mon, 15 Dec 2025 14:39:51 +0100	[thread overview]
Message-ID: <20251215133951.210548-1-s.sterz@proxmox.com> (raw)

the api expects a unix timestamp here, but submitting the raw field
will submit a rfc3999 timestamp. this happens when a user has expire
set and is updated, but the expire field itself isn't changed. the ui
would then submit the raw expire field. to fix this, don't submit the
field by itself.

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
---
 src/user_panel.rs | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/user_panel.rs b/src/user_panel.rs
index f7af395..44d934f 100644
--- a/src/user_panel.rs
+++ b/src/user_panel.rs
@@ -532,7 +532,8 @@ fn add_user_input_panel(form_ctx: &FormContext) -> Html {
             tr!("Expire"),
             Field::new()
                 .name("expire")
-                .input_type(InputType::DatetimeLocal),
+                .input_type(InputType::DatetimeLocal)
+                .submit(false),
         )
         .with_field(tr!("Enabled"), Checkbox::new().name("enable").default(true))
         .with_right_field(tr!("First name"), Field::new().name("firstname"))
@@ -559,7 +560,8 @@ fn edit_user_input_panel(_form_ctx: &FormContext) -> Html {
             tr!("Expire"),
             Field::new()
                 .name("expire")
-                .input_type(InputType::DatetimeLocal),
+                .input_type(InputType::DatetimeLocal)
+                .submit(false),
         )
         .with_right_field(tr!("Last name"), Field::new().name("lastname"))
         .with_field(tr!("EMail"), Field::new().name("email"))
-- 
2.47.3



_______________________________________________
yew-devel mailing list
yew-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/yew-devel


             reply	other threads:[~2025-12-15 13:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-15 13:39 Shannon Sterz [this message]
2025-12-16 16:57 ` [yew-devel] applied: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251215133951.210548-1-s.sterz@proxmox.com \
    --to=s.sterz@proxmox.com \
    --cc=yew-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal