Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Sith
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
59
Issues
59
List
Boards
Labels
Service Desk
Milestones
Merge Requests
9
Merge Requests
9
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
AE
Sith
Commits
73228820
Commit
73228820
authored
Jun 10, 2018
by
Sli
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'new_django' into 'master'
Fix user pictures display See merge request
!152
parents
1cfc4f80
5c4a16d1
Pipeline
#1506
passed with stage
in 5 minutes and 43 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
core/views/user.py
core/views/user.py
+3
-2
sas/models.py
sas/models.py
+7
-2
No files found.
core/views/user.py
View file @
73228820
...
...
@@ -254,7 +254,7 @@ class UserPicturesView(UserTabsMixin, CanViewMixin, DetailView):
kwargs
=
super
(
UserPicturesView
,
self
).
get_context_data
(
**
kwargs
)
kwargs
[
'albums'
]
=
[]
kwargs
[
'pictures'
]
=
{}
picture_qs
=
self
.
object
.
pictures
.
exclude
(
picture
=
None
).
order_by
(
'-picture__parent__date'
,
'id'
).
select_related
(
'picture__parent
__name
'
)
picture_qs
=
self
.
object
.
pictures
.
exclude
(
picture
=
None
).
order_by
(
'-picture__parent__date'
,
'id'
).
select_related
(
'picture__parent'
)
last_album
=
None
for
pict_relation
in
picture_qs
:
album
=
pict_relation
.
picture
.
parent
...
...
@@ -262,10 +262,10 @@ class UserPicturesView(UserTabsMixin, CanViewMixin, DetailView):
kwargs
[
'albums'
].
append
(
album
)
kwargs
[
'pictures'
][
album
.
id
]
=
[]
last_album
=
album
.
id
print
(
album
,
album
.
date
)
kwargs
[
'pictures'
][
album
.
id
].
append
(
pict_relation
.
picture
)
return
kwargs
def
DeleteUserGodfathers
(
request
,
user_id
,
godfather_id
,
is_father
):
user
=
User
.
objects
.
get
(
id
=
user_id
)
if
((
user
==
request
.
user
)
or
...
...
@@ -280,6 +280,7 @@ def DeleteUserGodfathers(request, user_id, godfather_id, is_father):
raise
PermissionDenied
return
redirect
(
'core:user_godfathers'
,
user_id
=
user_id
)
class
UserGodfathersView
(
UserTabsMixin
,
CanViewMixin
,
DetailView
):
"""
Display a user's godfathers
...
...
sas/models.py
View file @
73228820
...
...
@@ -35,15 +35,18 @@ import os
from
core.models
import
SithFile
,
User
from
core.utils
import
resize_image
,
exif_auto_rotate
class
SASPictureManager
(
models
.
Manager
):
def
get_queryset
(
self
):
return
super
(
SASPictureManager
,
self
).
get_queryset
().
filter
(
is_in_sas
=
True
,
is_folder
=
False
)
is_folder
=
False
)
class
SASAlbumManager
(
models
.
Manager
):
def
get_queryset
(
self
):
return
super
(
SASAlbumManager
,
self
).
get_queryset
().
filter
(
is_in_sas
=
True
,
is_folder
=
True
)
is_folder
=
True
)
class
Picture
(
SithFile
):
class
Meta
:
...
...
@@ -163,6 +166,7 @@ class Album(SithFile):
self
.
file
.
name
=
self
.
name
+
'/thumb.jpg'
self
.
save
()
def
sas_notification_callback
(
notif
):
count
=
Picture
.
objects
.
filter
(
is_moderated
=
False
).
count
()
if
count
:
...
...
@@ -172,6 +176,7 @@ def sas_notification_callback(notif):
notif
.
param
=
"%s"
%
count
notif
.
date
=
timezone
.
now
()
class
PeoplePictureRelation
(
models
.
Model
):
"""
The PeoplePictureRelation class makes the connection between User and Picture
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment