@@ -117,6 +129,8 @@
Inscription
* - add buyer_kind_detail field (and make it required)
* - add position field (and make it required)
* - add survey checkbox for newsletter
+ * - if the user is an INDIVIDUAL:
+ * - hide company section
*/
document.addEventListener('DOMContentLoaded', function() {
let phoneInput = document.getElementById('id_phone');
@@ -164,10 +178,11 @@ Inscription
} else {
toggleInputElement(false, element=partnerKindInput, required=false);
}
- if(radio.value){
- infoStructuresFieldset.classList.remove('d-none');
- } else { //empty
+
+ if (radio.value === 'INDIVIDUAL') {
infoStructuresFieldset.classList.add('d-none');
+ } else {
+ infoStructuresFieldset.classList.remove('d-none');
}
}));
});
diff --git a/lemarche/users/models.py b/lemarche/users/models.py
index 21802bb96..89b95f0ef 100644
--- a/lemarche/users/models.py
+++ b/lemarche/users/models.py
@@ -137,6 +137,7 @@ class User(AbstractUser):
KIND_SIAE = user_constants.KIND_SIAE
KIND_BUYER = user_constants.KIND_BUYER
KIND_PARTNER = user_constants.KIND_PARTNER
+ KIND_INDIVIDUAL = user_constants.KIND_INDIVIDUAL
KIND_ADMIN = user_constants.KIND_ADMIN
username = None
diff --git a/lemarche/www/auth/forms.py b/lemarche/www/auth/forms.py
index a43a83af1..1c82d7bbc 100644
--- a/lemarche/www/auth/forms.py
+++ b/lemarche/www/auth/forms.py
@@ -14,6 +14,7 @@ class SignupForm(UserCreationForm):
(User.KIND_SIAE, "Une entreprise sociale inclusive (SIAE ou structure du handicap, GEIQ)"),
(User.KIND_BUYER, "Un acheteur"),
(User.KIND_PARTNER, "Un partenaire (réseaux, facilitateurs)"),
+ (User.KIND_INDIVIDUAL, "Un particulier"),
)
FORM_PARTNER_KIND_CHOICES = EMPTY_CHOICE + user_constants.PARTNER_KIND_CHOICES