Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SCODOC_R6A06
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Antoine Pourthié
SCODOC_R6A06
Commits
2fcd6f6a
Commit
2fcd6f6a
authored
5 months ago
by
Antoine Pourthié
Browse files
Options
Downloads
Patches
Plain Diff
methode de notification des demissions
parent
4fb08c9a
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/models/formsemestre.py
+20
-0
20 additions, 0 deletions
app/models/formsemestre.py
with
20 additions
and
0 deletions
app/models/formsemestre.py
+
20
−
0
View file @
2fcd6f6a
...
...
@@ -1192,6 +1192,26 @@ class FormSemestre(models.ScoDocModel):
"
[ScoDoc]
"
+
subject
,
email
.
get_from_addr
(),
destinations
,
txt
)
def
_notify_demission
(
self
,
etud
:
Identite
)
->
None
:
"
Notifie la démission d
'
un étudiant: envoie un mail selon paramétrage
"
destinations
=
(
sco_preferences
.
get_preference
(
"
emails_notifications_demissions
"
,
self
.
id
)
or
""
)
destinations
=
[
x
.
strip
()
for
x
in
destinations
.
split
(
"
,
"
)]
destinations
=
[
x
for
x
in
destinations
if
x
]
if
not
destinations
:
return
txt
=
f
"""
{
etud
.
nom_prenom
()
}
a démissionné
{
etud
.
e
}
en
{
self
.
titre_annee
()
}
"""
subject
=
f
"""
Démission de
{
etud
.
nom_prenom
()
}
en
{
self
.
titre_annee
()
}
"""
# build mail
log
(
f
"
_notify_demission: sending notification to
{
destinations
}
"
)
log
(
f
"
_notify_demission: subject:
{
subject
}
"
)
log
(
txt
)
email
.
send_email
(
"
[ScoDoc]
"
+
subject
,
email
.
get_from_addr
(),
destinations
,
txt
)
def
get_partitions_list
(
self
,
with_default
=
True
,
only_listed
=
False
)
->
list
[
Partition
]:
...
...
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