Skip to content

Commit ca5f216

Browse files
Merge pull request #1073 from scidsg/hangul-urls
add alias validator
2 parents 59a08df + 81d9eaa commit ca5f216

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

assets/js/directory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ document.addEventListener("DOMContentLoaded", function () {
9696
<div class="badgeContainer">${badgeContainer}</div>
9797
${bioHighlighted ? `<p class="bio">${bioHighlighted}</p>` : ""}
9898
<div class="user-actions">
99-
<a href="${pathPrefix}/to/${encodeURIComponent(user.primary_username)}">View Profile</a>
99+
<a href="${pathPrefix}/to/${user.primary_username}">View Profile</a>
100100
${isSessionUser ? `<a href="#" class="report-link" data-username="${user.primary_username}" data-display-name="${user.display_name || user.primary_username}" data-bio="${user.bio ?? "No bio"}">Report Account</a>` : ``}
101101
</div>
102102
`;

assets/js/directory_verified.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ document.addEventListener("DOMContentLoaded", function () {
129129
: ""
130130
}
131131
<div class="user-actions">
132-
<a href="${pathPrefix}/to/${encodeURIComponent(user.primary_username)}">View Profile</a>
132+
<a href="${pathPrefix}/to/${user.primary_username}">View Profile</a>
133133
${
134134
isSessionUser
135135
? `<a href="#" class="report-link" data-username="${

hushline/settings/forms.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
from hushline.db import db
3232
from hushline.forms import Button, CanonicalHTML, ComplexPassword, HexColor, ValidTemplate
3333
from hushline.model import FieldType, MessageStatus, SMTPEncryption, Username
34+
from hushline.routes.common import valid_username
3435

3536

3637
class ChangePasswordForm(FlaskForm):
@@ -146,6 +147,7 @@ class NewAliasForm(FlaskForm):
146147
validators=[
147148
DataRequired(),
148149
Length(min=Username.USERNAME_MIN_LENGTH, max=Username.USERNAME_MAX_LENGTH),
150+
valid_username,
149151
],
150152
)
151153
submit = SubmitField("Add Alias", name="new_alias", widget=Button())

hushline/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.4.78"
1+
__version__ = "0.4.79"

0 commit comments

Comments
 (0)