Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Django Favicon Plus Reloaded
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Libraries
Django Favicon Plus Reloaded
Commits
7be32905
Commit
7be32905
authored
3 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Plain Diff
Merge branch '5-name-favicons-dynamically' into 'master'
Resolve "Name favicons dynamically" Closes
#5
See merge request
!5
parents
102e75a8
27b236ca
No related branches found
No related tags found
1 merge request
!5
Resolve "Name favicons dynamically"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
favicon/models.py
+3
-1
3 additions, 1 deletion
favicon/models.py
with
3 additions
and
1 deletion
favicon/models.py
+
3
−
1
View file @
7be32905
...
...
@@ -7,6 +7,7 @@ from django.core.files.storage import default_storage as storage
from
django.core.files.uploadedfile
import
InMemoryUploadedFile
from
django.db
import
models
from
django.db.models
import
Q
,
signals
from
django.utils.text
import
slugify
use_sites
=
hasattr
(
settings
,
"
SITE_ID
"
)
...
...
@@ -138,7 +139,8 @@ class FaviconImg(models.Model):
tmp_io
=
BytesIO
()
tmp
.
save
(
tmp_io
,
format
=
'
PNG
'
)
tmp_file
=
InMemoryUploadedFile
(
tmp_io
,
None
,
f
"
fav-
{
self
.
size
}
s.png
"
,
'
image/png
'
,
sys
.
getsizeof
(
tmp_io
),
None
)
file_name
=
f
"
{
slugify
(
self
.
faviconFK
.
title
)
}
-
{
self
.
size
}
s.png
"
tmp_file
=
InMemoryUploadedFile
(
tmp_io
,
None
,
file_name
,
'
image/png
'
,
sys
.
getsizeof
(
tmp_io
),
None
)
self
.
faviconImage
=
tmp_file
...
...
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