Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TJTS5901 K23 Template
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Startuplab
Courses
TJTS5901 Continuous Software Engineering
TJTS5901 K23 Template
Commits
72abed8f
Commit
72abed8f
authored
2 years ago
by
Teemu Autto
Browse files
Options
Downloads
Patches
Plain Diff
Default profile picture.
parent
ff35a25e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#15926
passed
2 years ago
Stage: build
Stage: test
Stage: staging
Stage: smoketest
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/tjts5901/models.py
+4
-1
4 additions, 1 deletion
src/tjts5901/models.py
src/tjts5901/static/img/default-profile.png
+0
-0
0 additions, 0 deletions
src/tjts5901/static/img/default-profile.png
with
4 additions
and
1 deletion
src/tjts5901/models.py
+
4
−
1
View file @
72abed8f
from
datetime
import
datetime
from
secrets
import
token_urlsafe
from
urllib.parse
import
urlencode
from
flask
import
url_for
from
markupsafe
import
Markup
...
...
@@ -51,7 +52,9 @@ class User(UserMixin, db.Document):
import
hashlib
digest
=
hashlib
.
md5
(
self
.
email
.
lower
().
encode
(
"
utf-8
"
)).
hexdigest
()
return
f
"
https://www.gravatar.com/avatar/
{
digest
}
?s=200
"
default
=
url_for
(
"
static
"
,
filename
=
"
img/default-profile.png
"
,
_external
=
True
)
params
=
urlencode
({
"
s
"
:
200
,
"
d
"
:
default
})
return
f
"
https://www.gravatar.com/avatar/
{
digest
}
?
{
params
}
"
@property
def
is_active
(
self
)
->
bool
:
...
...
This diff is collapsed.
Click to expand it.
src/tjts5901/static/img/default-profile.png
0 → 100644
+
0
−
0
View file @
72abed8f
77.1 KiB
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment