Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/challenge-fen' into challenge-fen
Browse files Browse the repository at this point in the history
  • Loading branch information
johndoknjas committed Jan 29, 2025
2 parents 27d2f1a + 436775c commit 781f79f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 23 deletions.
5 changes: 2 additions & 3 deletions modules/api/src/main/AccountTermination.scala
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,8 @@ final class AccountTermination(
else doDeleteNow(user, del).inject(user.some)

private def doDeleteNow(u: User, del: UserDelete): Funit = for
playbanned <- playbanApi.hasCurrentPlayban(u.id)
closedByMod <- modLogApi.closedByMod(u)
tos = u.marks.dirty || closedByMod || playbanned
playbanned <- playbanApi.hasCurrentPlayban(u.id)
tos = u.marks.dirty || playbanned
_ = logger.info(s"Deleting user ${u.username} tos=$tos erase=${del.erase}")
_ <- if tos then userRepo.delete.nowWithTosViolation(u) else userRepo.delete.nowFully(u)
_ <- activityWrite.deleteAll(u)
Expand Down
11 changes: 6 additions & 5 deletions modules/user/src/main/UserRepo.scala
Original file line number Diff line number Diff line change
Expand Up @@ -370,21 +370,22 @@ final class UserRepo(c: Coll)(using Executor) extends lila.core.user.UserRepo(c)
bpass,
"mustConfirmEmail",
colorIt,
F.foreverClosed
F.foreverClosed,
F.delete
)
coll.update.one(
$id(user.id),
$unset(fields) ++ $set(s"${F.delete}.done" -> true)
$unset(fields) ++ $set("deletedAt" -> nowInstant)
)

def nowFully(user: User) = for
lockEmail <- emailOrPrevious(user.id)
_ <- coll.update.one(
$id(user.id),
$doc(
"prevEmail" -> lockEmail,
"createdAt" -> user.createdAt,
s"${F.delete}.done" -> true
"prevEmail" -> lockEmail,
"createdAt" -> user.createdAt,
"deletedAt" -> nowInstant
)
)
yield ()
Expand Down
17 changes: 4 additions & 13 deletions modules/web/src/main/ui/contact.scala
Original file line number Diff line number Diff line change
Expand Up @@ -260,19 +260,10 @@ object contact:
List(
Leaf(
"gdpr",
"GDPR",
frag(
p("You may request the deletion of your Lichess account."),
p(
"First, ",
a(href := routes.Account.close)("close your account"),
"."
),
p(
"Then send us an email at ",
contactEmailLink(contactEmail.value),
" to request the definitive erasure of all data linked to the account."
)
"GDPR erasure",
p(
"You may request the ",
a(href := routes.Account.delete)("complete deletion of your Lichess account.")
)
),
Leaf(
Expand Down
2 changes: 1 addition & 1 deletion translation/source/contact.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<string name="closeYourAccount">You can close your account on this page</string>
<string name="doNotAskByEmail">Do not ask us by email to close an account, we won't do it.</string>
<string name="wantReopen">I want to reopen my account</string>
<string name="reopenOnThisPage">You can reopen your account on this page. It only works once.</string>
<string name="reopenOnThisPage">You can reopen your account on this page.</string>
<string name="doNotAskByEmailToReopen">Do not ask us by email to reopen an account, we won't do it.</string>
<string name="wantChangeUsername">I want to change my username</string>
<string name="changeUsernameCase">Visit this page to change the case of your username</string>
Expand Down
2 changes: 1 addition & 1 deletion ui/@types/lichess/i18n.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ interface I18n {
otherRestriction: string;
/** Make sure you played a rated game. Casual games do not affect the players ratings. */
ratedGame: string;
/** You can reopen your account on this page. It only works once. */
/** You can reopen your account on this page. */
reopenOnThisPage: string;
/** In the Lichess Discord server */
reportBugInDiscord: string;
Expand Down

0 comments on commit 781f79f

Please sign in to comment.