Fix: Prevent duplicate expiration date warnings for access tokens

What does this MR do and why?

This MR fixes a bug where users would see duplicate error messages for the expires_at field when creating a Personal Access Token (PAT). The problem was caused by the same validation being defined in both the Community Edition (CE) and Enterprise Edition (EE) code, so it ended up running twice.

To solve this, we’ve updated the EE validation to properly override the one in CE using override :expires_at_before_max_expiry_date. With this change, users will now see a single, clear error message when the expiration date exceeds the allowed limit.

It also ensures that EE-specific validations only run when needed, and otherwise the CE behavior is used as expected.

relates to #508498 (closed)

Edited by Pratibha Gupta

Merge request reports

Loading
Loading