-
Notifications
You must be signed in to change notification settings - Fork 0
[Users] Added privacy controls to user profiles #1540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
harriet-fisher
wants to merge
10
commits into
dev
Choose a base branch
from
users/privacy-settings
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e223e5b
WIP: Added functionality to manage privacy for users. Affects both fr…
harriet-fisher 930580d
Merge branch 'dev' into users/privacy-settings
harriet-fisher 7980095
migration issues
harriet-fisher 23beb47
formatting changes
harriet-fisher ecb5fca
Merge dev into users/privacy-settings
harriet-fisher 7de883e
fixed migration issues and url bug preventing UI from functioning as …
harriet-fisher 38d6cba
Merge branch 'dev' into users/privacy-settings
harriet-fisher ef7b1eb
Merge branch 'dev' into users/privacy-settings
harriet-fisher 791ba90
Merge branch 'dev' into users/privacy-settings
harriet-fisher 0012040
Merge branch 'dev' into users/privacy-settings
harriet-fisher File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/chigame/users/migrations/0015_userprofile_friend_request_permission_and_more.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # Generated by Django 4.2.20 on 2025-05-24 04:52 | ||
|
|
||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
| dependencies = [ | ||
| ("users", "0011_alter_friendinvitation_unique_together_and_more"), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AddField( | ||
| model_name="userprofile", | ||
| name="friend_request_permission", | ||
| field=models.CharField( | ||
| choices=[("everyone", "Everyone"), ("friends_of_friends", "Friends of Friends"), ("nobody", "Nobody")], | ||
| default="everyone", | ||
| help_text="Who can send you friend requests", | ||
| max_length=20, | ||
| ), | ||
| ), | ||
| migrations.AddField( | ||
| model_name="userprofile", | ||
| name="profile_visibility", | ||
| field=models.CharField( | ||
| choices=[("public", "Public"), ("friends", "Friends Only"), ("private", "Private")], | ||
| default="public", | ||
| help_text="Who can view your profile", | ||
| max_length=10, | ||
| ), | ||
| ), | ||
| migrations.AddField( | ||
| model_name="userprofile", | ||
| name="searchable_by_strangers", | ||
| field=models.BooleanField(default=True, help_text="Allow strangers to find you in search"), | ||
| ), | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| {% extends "base.html" %} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. looks great! |
||
|
|
||
| {% load static %} | ||
|
|
||
| {% block title %} | ||
| Privacy Settings | ||
| {% endblock title %} | ||
| {% block content %} | ||
| <div class="container mt-5"> | ||
| <div class="row"> | ||
| <div class="col-md-8 offset-md-2"> | ||
| <div class="card"> | ||
| <div class="card-header"> | ||
| <h3>Privacy Settings</h3> | ||
| </div> | ||
| <div class="card-body"> | ||
| <form method="post"> | ||
| {% csrf_token %} | ||
| <div class="mb-3"> | ||
| <label for="{{ form.profile_visibility.id_for_label }}" class="form-label"> | ||
| <strong>Profile Visibility</strong> | ||
| </label> | ||
| {{ form.profile_visibility }} | ||
| <div class="form-text">{{ form.profile_visibility.help_text }}</div> | ||
| </div> | ||
| <div class="mb-3"> | ||
| <label for="{{ form.friend_request_permission.id_for_label }}" | ||
| class="form-label"> | ||
| <strong>Friend Request Permission</strong> | ||
| </label> | ||
| {{ form.friend_request_permission }} | ||
| <div class="form-text">{{ form.friend_request_permission.help_text }}</div> | ||
| </div> | ||
| <div class="mb-3"> | ||
| <div class="form-check"> | ||
| {{ form.searchable_by_strangers }} | ||
| <label for="{{ form.searchable_by_strangers.id_for_label }}" | ||
| class="form-check-label"> | ||
| <strong>Searchable by Strangers</strong> | ||
| </label> | ||
| </div> | ||
| <div class="form-text">{{ form.searchable_by_strangers.help_text }}</div> | ||
| </div> | ||
| <div class="d-flex justify-content-between"> | ||
| <a href="{% url 'users:user-profile' request.user.pk %}" | ||
| class="btn btn-secondary">Back to Profile</a> | ||
| <button type="submit" class="btn btn-primary">Save Settings</button> | ||
| </div> | ||
| </form> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| {% endblock content %} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great addition!