-
-
Notifications
You must be signed in to change notification settings - Fork 775
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
Users list #4011
Users list #4011
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4011 +/- ##
=========================================
- Coverage 30.01% 30% -0.01%
=========================================
Files 205 205
Lines 16000 16007 +7
Branches 2111 2111
=========================================
+ Hits 4802 4803 +1
- Misses 11026 11032 +6
Partials 172 172
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #4011 +/- ##
=========================================
+ Coverage 30.26% 30.37% +0.1%
=========================================
Files 206 206
Lines 16370 16397 +27
Branches 2152 2154 +2
=========================================
+ Hits 4955 4981 +26
+ Misses 11239 11236 -3
- Partials 176 180 +4
Continue to review full report at Codecov.
|
hey @PixelantDesign @danlipert i spoke with @octavioamu this morning. we were thinking about releasing this this week so it can be used in the ethereal hackathon ( what exists now => http://bits.owocki.com/1cba8654c7ba/Image%202019-04-10%20at%202.23.46%20PM.png is basic search ) then we will build in the fuller features #4019 from there i think we
how does that sound? |
Works for me if it's in a good enough state. Though, I have not tested. |
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.
Almost there 👍
</button> | ||
|
||
<div class="collapse navbar-collapse" id="usersFilters"> | ||
<!-- <div class="navbar-nav mr-4"> |
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.
Whats up with this fat comment? :)
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.
is for the next version
username="user{}".format(i)) | ||
profile = Profile.objects.create(user=user, data={}, handle="{}".format(i)) | ||
|
||
def test_user_list(self): |
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.
nice! :D
app/dashboard/views.py
Outdated
context = {} | ||
user_list = Profile.objects.all().order_by(order_by).filter(handle__icontains=q).cache() | ||
|
||
# all_notifs = Notification.objects.filter(to_user_id=request.user.id).order_by('-id') |
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.
leftover comment
app/dashboard/views.py
Outdated
@require_GET | ||
def users_fetch(request): | ||
"""Handle displaying users.""" | ||
q = request.GET.get('search','') |
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.
add a space before the final string here like q = request.GET.get('search', '')
app/dashboard/views.py
Outdated
all_pages = Paginator(user_list, limit) | ||
all_users = [] | ||
for user in all_pages.page(page): | ||
print(user) |
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.
leftover debugging print?
app/dashboard/views.py
Outdated
profile_json = {} | ||
profile_json = user.to_standard_dict() | ||
if user.avatar_baseavatar_related.exists(): | ||
profile_json['avatar_id'] = user.avatar_baseavatar_related.first().pk |
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.
Better here to assign a var to user.avatar_baseavatar_related.first()
and then access the .pk
and .avatar_url
from that var. Calling .first()
multiple times re-queries the database
Description
Checklist
Affected core subsystem(s)
Refers/Fixes
Refs: #4019
Testing and Sign-off
Contributor
make test
and everything passed!Reviewer
Funder