-
Notifications
You must be signed in to change notification settings - Fork 34
feat: Add avatars #331
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
Open
orronai
wants to merge
14
commits into
master
Choose a base branch
from
edit-profile
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: Add avatars #331
Changes from 3 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
c3e3d66
feat: Add avatars
orronai d50bfda
'Refactored by Sourcery' (#332)
sourcery-ai[bot] 657715e
Added the mkdir of the avatars path if it doesn't exist
orronai 215b341
- Merged with master
orronai d2d51e7
Merge branch 'master' of https://github.com/PythonFreeCourse/lms into…
orronai 7f44c03
Image saving proccess is now async
orronai ddd195f
fixed translations
orronai 1fb34b9
fixed asyncio test
orronai 2314d37
fixed asyncio test
orronai 997899f
fixed asyncio test
orronai b1de37a
fixed asyncio test
orronai 791fd06
fix merge conflicts
orronai f647f9e
Merge branch 'master' into edit-profile
orronai 3052f0b
removed unnecessary line
orronai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -136,3 +136,6 @@ lms/lmsweb/config.py | |
db.sqlite | ||
vim.session | ||
devops/rabbitmq.cookie | ||
|
||
# Avatars | ||
lms/static/avatars/* | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from flask_babel import gettext as _ # type: ignore | ||
from flask_wtf import FlaskForm | ||
from flask_wtf.file import FileAllowed, FileField, FileRequired, FileSize | ||
|
||
from lms.lmsweb.config import MAX_UPLOAD_SIZE | ||
from lms.utils.files import ALLOWED_IMAGES_EXTENSIONS | ||
|
||
|
||
class UpdateAvatarForm(FlaskForm): | ||
avatar = FileField( | ||
'Avatar', validators=[ | ||
FileAllowed(list(ALLOWED_IMAGES_EXTENSIONS)), | ||
orronai marked this conversation as resolved.
Show resolved
Hide resolved
|
||
FileRequired(message=_('No file added')), | ||
FileSize( | ||
max_size=MAX_UPLOAD_SIZE, message=_( | ||
'File size is too big - %(size)dMB allowed', | ||
size=MAX_UPLOAD_SIZE // 1000000, | ||
orronai marked this conversation as resolved.
Show resolved
Hide resolved
|
||
), | ||
), | ||
], | ||
) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.