Skip to content

Commit

Permalink
[UI] Remove tick mark referring to third-party agreement (#4584)
Browse files Browse the repository at this point in the history
Fixes #4583: [UI] remove tickmark from profile 
* [LANGUAGE] -> HTML
* [FIX] -> removed the 'agree_third_party' checkbox as required in issue #4583

```diff
- <div class="flex flex-row gap-4 items-center border-gray-400 border p-4 rounded-lg">
-   <input type="checkbox" name="agree_terms" id="agree_terms" required class="" {% if public_settings %}checked{% endif %}>
-    <label for="agree_terms" class="cursor-pointer w-full">{{_('public_profile_info')}}</label>
- <div>
```
  • Loading branch information
ghubrakesh authored Oct 7, 2023
1 parent d99a38a commit 5fee4d5
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 16 deletions.
3 changes: 0 additions & 3 deletions messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,6 @@ msgstr ""
msgid "agree_invalid"
msgstr ""

msgid "agree_third_party"
msgstr ""

msgid "agree_with"
msgstr ""

Expand Down
1 change: 0 additions & 1 deletion templates/admin/admin-users.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ <h4 class="text-center">Total amount of shown users: {{ users|length }}</h4>
<td id="experience_header" class="hidden">Experience</td>
<td id="tags_header" class="text-center">Tags</td>
<td id="teacher_header" class="text-center">Teacher</td>
<td id="third_party_header" class="hidden" class="text-center">Third Party</td>
<td id="verified_header" class="hidden">Verified</td>
</tr>
</thead>
Expand Down
4 changes: 0 additions & 4 deletions templates/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,6 @@ <h2 class="profile-section-body-header">{{_('settings')}}</h2>
{% endfor %}
</select>
</div>
<div class="flex flex-row items-center mt-4 gap-4">
<input type="checkbox" id="agree_third_party" name="agree_third_party" {% if user_data['third_party'] %}checked{% endif %}>
<label class="text-center" for="agree_third_party">{{_('agree_third_party')}}</label>
</div>
<div class="mb-4">
<button type="submit" class="green-btn mt-4">{{_('update_profile')}}</button>
</div>
Expand Down
2 changes: 0 additions & 2 deletions website/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,13 @@ def get_admin_users_page(self, user):
"experience_languages",
"language",
"keyword_language",
"third_party",
]

for user in users:
data = pick(user, *fields)
data["email_verified"] = not bool(data["verification_pending"])
data["is_teacher"] = bool(data["is_teacher"])
data["teacher_request"] = True if data["teacher_request"] else None
data["third_party"] = True if data["third_party"] else None
data["created"] = utils.timestamp_to_date(data["created"])
data["last_login"] = utils.timestamp_to_date(data["last_login"]) if data.get("last_login") else None
if category == "language":
Expand Down
1 change: 0 additions & 1 deletion website/auth_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,6 @@ def store_new_account(self, account, email):
"keyword_language": account["keyword_language"],
"created": timems(),
"teacher_request": True if account.get("is_teacher") else None,
"third_party": True if account.get("agree_third_party") else None,
"verification_pending": hashed_token,
"last_login": timems(),
}
Expand Down
6 changes: 1 addition & 5 deletions website/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,6 @@ def update_profile(self, user):
updates[field] = body[field]
else:
updates[field] = None
if body.get("agree_third_party"):
updates["third_party"] = True
else:
updates["third_party"] = None

if updates:
self.db.update_user(username, updates)
Expand All @@ -146,7 +142,7 @@ def get_profile(self, user):
user = self.db.user_by_username(user["username"])

output = {"username": user["username"], "email": user["email"], "language": user.get("language", "en")}
for field in ["birth_year", "country", "gender", "prog_experience", "experience_languages", "third_party"]:
for field in ["birth_year", "country", "gender", "prog_experience", "experience_languages"]:
if field in user:
output[field] = user[field]
if "verification_pending" in user:
Expand Down

0 comments on commit 5fee4d5

Please sign in to comment.