Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kszkepzes-backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
JetBrains YouTrack
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
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
KSZK
DevTeam
kszkepzes
old
kszkepzes-backend
Commits
13d4eb83
Commit
13d4eb83
authored
6 years ago
by
Bodor Máté
Browse files
Options
Downloads
Patches
Plain Diff
Create email
parent
f3a723c6
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/account/auth_pipeline.py
+3
-3
3 additions, 3 deletions
src/account/auth_pipeline.py
src/common/email.py
+29
-3
29 additions, 3 deletions
src/common/email.py
src/kszkepzes/settings/production.py
+2
-10
2 additions, 10 deletions
src/kszkepzes/settings/production.py
with
34 additions
and
16 deletions
src/account/auth_pipeline.py
+
3
−
3
View file @
13d4eb83
from
django.core
import
exceptions
from
common.email
import
registration
_email
from
common.email
import
registration
from
.
import
models
def
create_profile
(
backend
,
user
,
response
,
*
args
,
**
kwargs
):
if
backend
.
name
==
'
authsch
'
:
if
user
.
email
is
not
None
:
registration_email
(
user
.
email
)
try
:
user
.
profile
except
exceptions
.
ObjectDoesNotExist
:
models
.
Profile
.
objects
.
create
(
user
=
user
)
if
user
.
email
is
not
None
:
registration
(
user
.
email
)
This diff is collapsed.
Click to expand it.
src/common/email.py
+
29
−
3
View file @
13d4eb83
from
django.core.mail
import
send_mail
def
registration_email
(
email
):
send_mail
(
'
TESZT
'
,
'
Udvozlunk a kszkepzesen, ne felejtsd el kitolteni a profilod.
'
,
'
noreply@devteam.sch.bme.hu
'
,
[
email
,
])
\ No newline at end of file
def
registration
(
email
):
subject
=
"
REGISTRATION TEST
"
message
=
"
Üdvözlünk a kszképzésen!
"
send_mail
(
subject
,
message
,
'
noreply@devteam.sch.bme.hu
'
,
[
email
,
])
def
admitted
(
email
):
subject
=
"
ADMITTED TEST
"
message
=
"
Gratulálunk, te vagy a kiválasztott!!
"
send_mail
(
subject
,
message
,
'
noreply@devteam.sch.bme.hu
'
,
[
email
,
])
def
denied
(
email
):
subject
=
"
DENIED TEST
"
message
=
"
Sajnos idén nem nyertél felvételt, próbáld meg legközelebb
"
send_mail
(
subject
,
message
,
'
noreply@devteam.sch.bme.hu
'
,
[
email
,
])
def
new_homework
(
email
):
subject
=
"
NEW HOMEWORK TEST
"
message
=
"
Szia!
\n
Egy új házi lett kiadva, ha tíz percen belül megoldod akkor fasza gyerek vagy,
"
\
"
ha nem életed végéig bánnifogod...
"
send_mail
(
subject
,
message
,
'
noreply@devteam.sch.bme.hu
'
,
[
email
,
])
def
homework_corrected
(
email
):
subject
=
"
HOMEWORK CORRECTED TEST
"
message
=
"
Nagyszerű mentoraink kijavították házifeladatod, vajon most kaptál meglepit?!
"
send_mail
(
subject
,
message
,
'
noreply@devteam.sch.bme.hu
'
,
[
email
,
])
This diff is collapsed.
Click to expand it.
src/kszkepzes/settings/production.py
+
2
−
10
View file @
13d4eb83
...
...
@@ -27,14 +27,6 @@ REST_FRAMEWORK = {
STATIC_ROOT
=
os
.
path
.
join
(
BASE_DIR
,
'
static_collected
'
)
# EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
# EMAIL_HOST = 'mail.sch.bme.hu'
# EMAIL_USE_TLS = True
# EMAIL_PORT = 587
EMAIL_BACKEND
=
'
django.core.mail.backends.smtp.EmailBackend
'
EMAIL_HOST
=
'
smtp.gmail.com
'
EMAIL_USE_TLS
=
True
EMAIL_PORT
=
587
EMAIL_HOST_USER
=
'
bmate711kamu@gmail.com
'
EMAIL_HOST_PASSWORD
=
'
1IronxDog
'
EMAIL_HOST
=
'
mail.sch.bme.hu
'
EMAIL_PORT
=
25
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