]> git.parisson.com Git - teleforma.git/commitdiff
Modify profile : https://trackers.pilotsystems.net/prebarreau/0375
authorYoan Le Clanche <yoanl@pilotsystems.net>
Tue, 22 Mar 2022 13:41:28 +0000 (14:41 +0100)
committerYoan Le Clanche <yoanl@pilotsystems.net>
Tue, 22 Mar 2022 13:41:28 +0000 (14:41 +0100)
teleforma/models/crfpa.py
teleforma/templates/teleforma/profile_detail.html

index 712bbf4b64a33b2aba9391fd02cffc45e137502b..5e65515ba22ade6c578b1f0bb7f39002aed467c8 100755 (executable)
@@ -395,6 +395,11 @@ class Student(models.Model):
                               online_paid = False,
                               type = self.payment_type)
             payment.save()
+
+    @property
+    def expiration_date(self):
+        """ closing date of student period """
+        return self.period.date_close_accounts
     
     class Meta(MetaCore):
         db_table = app_label + '_' + 'student'
index 656249e9fa7428a31819d4c822053b23fcc7ae79..706d5709b60203825221854470bf7154435e8371 100644 (file)
 
       {% if user.is_staff or user.is_superuser or usr == user %}
       <dt>{% trans "Email" %}</dt><dd>{{ usr.email }}</dd>
-          <dt>{% trans "Address" %}</dt><dd>{{ usr.profile.get.address }}{% if usr.profile.get.address_detail %}, {% endif %}</span>{{ usr.profile.get.address_detail }}{% if usr.profile.get.postal_code or usr.profile.get.city %}, {% endif %}{{ usr.profile.get.postal_code }} {{ usr.profile.get.city }}</dd>
+      <dt>{% trans "Address" %}</dt><dd>{{ usr.profile.get.address }}{% if usr.profile.get.address_detail %}, {{ usr.profile.get.address_detail }}{% endif %}{% if usr.profile.get.postal_code or usr.profile.get.city %}, {% endif %}{{ usr.profile.get.postal_code }} {{ usr.profile.get.city }}</dd>
+      {% endif %}
+      {% if user.is_staff or user.is_superuser or user.professor.get or usr == user %}
       <dt>{% trans "Telephone" %}</dt><dd>{{ usr.profile.get.telephone }}</dd>
+      {% endif %}
+      {% if user.is_staff or user.is_superuser or usr == user %}
       <dt>{% trans "WiFi login" %}</dt><dd>{{ usr.profile.get.wifi_login }}</dd>
       <dt>{% trans "WiFi password" %}</dt><dd>{{ usr.profile.get.wifi_pass }}</dd>
       {% endif %}
 
       <dt>{% trans "Date added" %}</dt><dd>{{ usr.date_joined }}</dd>
-      <dt>{% trans "Expiration date" %}</dt><dd>{{ usr.profile.get.expiration_date }}</dd>
+      {% if usr.student.get %}
+        <dt>{% trans "Expiration date" %}</dt><dd>{{ usr.student.get.expiration_date }}</dd>
+      {% endif %}
       <dt>{% trans "Last login" %}</dt><dd>{{ usr.last_login }}</dd>
 
       {% if user.is_authenticated and user.username == usr.username %}