Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
R
red-ci-cd
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
red-group-test
red-ci-cd
Commits
89d1097b
Commit
89d1097b
authored
Jan 30, 2020
by
Gladys Forte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get_image management account serializer
parent
917160f1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
app/applicationlayer/management/account/serializer.py
app/applicationlayer/management/account/serializer.py
+12
-1
No files found.
app/applicationlayer/management/account/serializer.py
View file @
89d1097b
...
...
@@ -10,6 +10,13 @@ from app.applicationlayer.management.module.serializer import ModuleSerializer
from
app.entities.models
import
(
User
,
Department
,
UserImage
,
AllowedCompany
,
Application
,
Module
)
import
os
import
configparser
config
=
configparser
.
ConfigParser
()
config_file
=
os
.
path
.
join
(
'./'
,
'env.ini'
)
config
.
read
(
config_file
)
class
UserManagementRetreiveSerializer
(
serializers
.
ModelSerializer
):
...
...
@@ -79,9 +86,13 @@ class UserManagementRetreiveSerializer(serializers.ModelSerializer):
request
=
self
.
context
.
get
(
'request'
)
primayPic
=
user
.
user_images
.
filter
(
is_primary
=
True
)
.
first
()
ssl
=
config
[
'SETTINGS'
][
'SSL'
]
if
primayPic
:
path
=
request
.
build_absolute_uri
(
primayPic
.
image
.
url
)
if
ssl
==
"1"
or
ssl
==
1
:
path
=
path
.
replace
(
'http'
,
'https'
)
else
:
path
=
path
.
replace
(
'https'
,
'http'
)
return
path
else
:
return
request
.
build_absolute_uri
(
'/media/no-user.png'
)
...
...
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