forked from ScoDoc/ScoDoc
correction creation offre
This commit is contained in:
parent
0d8e7f4268
commit
9898ae5310
@ -62,6 +62,7 @@ from app.entreprises.models import (
|
|||||||
EntrepriseSite,
|
EntrepriseSite,
|
||||||
EntrepriseTaxeApprentissage,
|
EntrepriseTaxeApprentissage,
|
||||||
)
|
)
|
||||||
|
from app import db
|
||||||
from app.models import Identite, Departement
|
from app.models import Identite, Departement
|
||||||
from app.auth.models import User
|
from app.auth.models import User
|
||||||
|
|
||||||
@ -277,9 +278,10 @@ class OffreCreationForm(FlaskForm):
|
|||||||
|
|
||||||
self.correspondant.choices = [("", "")] + [
|
self.correspondant.choices = [("", "")] + [
|
||||||
(correspondant.id, f"{correspondant.nom} {correspondant.prenom}")
|
(correspondant.id, f"{correspondant.nom} {correspondant.prenom}")
|
||||||
for correspondant in EntrepriseCorrespondant.query.filter_by(
|
for correspondant in db.session.query(EntrepriseCorrespondant)
|
||||||
entreprise_id=self.hidden_entreprise_id.data
|
.join(EntrepriseSite, EntrepriseCorrespondant.site_id == EntrepriseSite.id)
|
||||||
)
|
.filter(EntrepriseSite.entreprise_id == self.hidden_entreprise_id.data)
|
||||||
|
.all()
|
||||||
]
|
]
|
||||||
|
|
||||||
self.depts.choices = [
|
self.depts.choices = [
|
||||||
@ -323,9 +325,10 @@ class OffreModificationForm(FlaskForm):
|
|||||||
|
|
||||||
self.correspondant.choices = [("", "")] + [
|
self.correspondant.choices = [("", "")] + [
|
||||||
(correspondant.id, f"{correspondant.nom} {correspondant.prenom}")
|
(correspondant.id, f"{correspondant.nom} {correspondant.prenom}")
|
||||||
for correspondant in EntrepriseCorrespondant.query.filter_by(
|
for correspondant in db.session.query(EntrepriseCorrespondant)
|
||||||
entreprise_id=self.hidden_entreprise_id.data
|
.join(EntrepriseSite, EntrepriseCorrespondant.site_id == EntrepriseSite.id)
|
||||||
)
|
.filter(EntrepriseSite.entreprise_id == self.hidden_entreprise_id.data)
|
||||||
|
.all()
|
||||||
]
|
]
|
||||||
|
|
||||||
self.depts.choices = [
|
self.depts.choices = [
|
||||||
|
Loading…
Reference in New Issue
Block a user