# 选项允许用户名不必以字母数字字符开始或结束

**URL:** <https://meta.discourse.org/t/option-for-username-not-to-be-required-to-start-or-end-with-alphanumeric/353595>\
**Category:** Feature\
**Created:** [2025 年2 月 21 日 12:19 UTC](https://meta.discourse.org/t/option-for-username-not-to-be-required-to-start-or-end-with-alphanumeric/353595 "2025-02-21T12:19:36Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

作者： ![NubeBuster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nubebuster/32/371096_2.png) [@NubeBuster](https://meta.discourse.org/u/NubeBuster)\
发布日期： [2025 年2 月 21 日 12:19 UTC](https://meta.discourse.org/t/option-for-username-not-to-be-required-to-start-or-end-with-alphanumeric/353595/1 "2025-02-21T12:19:36Z")

</div>

您好，

我在为我的 Minecraft 社区运行 Discourse。我要求用户在游戏内注册，以便论坛上的每个用户都是真正的 Minecraft 玩家。我已经通过 Discourse 的 API 成功设置了这一点。到目前为止一切顺利！

现在我遇到了一个问题。一位用户，在 Minecraft 中名为 SomeName\_，尝试注册，结果收到了（Discourse 生成的）消息：

 ![图片显示了一个通知屏幕，上面写着“账户创建失败：用户名必须以字母或数字结尾”，背景为绿色，风格像素化。（由 AI 标注）](https://global.discourse-cdn.com/meta/original/4X/5/9/0/59009b2c2f0410a46ff4579a5ce18ca3080eb602.png)

我查看了设置，但没有找到允许禁用此功能的站点设置。  
[查看代码](https://github.com/discourse/discourse/blob/e26a1175d7c33746bddbc858ad89e68cc14beefe/app/models/username_validator.rb#L134)，发现没有相关设置。

我的问题是，这是由于 Discourse 的技术限制吗？此外，我能否尝试添加一个站点设置来禁用此功能并提交一个 PR？

---

_[View the full topic](https://meta.discourse.org/t/option-for-username-not-to-be-required-to-start-or-end-with-alphanumeric/353595)._
