mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-23 20:03:11 +00:00
Merge branch 'gpg_fingerprint' into 'dev'
Gpg fingerprint See merge request federez/re2o!245
This commit is contained in:
commit
740843975a
4 changed files with 48 additions and 2 deletions
|
@ -301,6 +301,7 @@ class AdherentForm(FormRevMixin, FieldPermissionFormMixin, ModelForm):
|
|||
super(AdherentForm, self).__init__(*args, prefix=prefix, **kwargs)
|
||||
self.fields['name'].label = 'Prénom'
|
||||
self.fields['surname'].label = 'Nom'
|
||||
self.fields['email'].label = 'Adresse mail'
|
||||
self.fields['school'].label = 'Établissement'
|
||||
self.fields['comment'].label = 'Commentaire'
|
||||
self.fields['room'].label = 'Chambre'
|
||||
|
@ -319,6 +320,7 @@ class AdherentForm(FormRevMixin, FieldPermissionFormMixin, ModelForm):
|
|||
'room',
|
||||
'shell',
|
||||
'telephone',
|
||||
'gpg_fingerprint'
|
||||
]
|
||||
|
||||
def clean_telephone(self):
|
||||
|
@ -331,6 +333,12 @@ class AdherentForm(FormRevMixin, FieldPermissionFormMixin, ModelForm):
|
|||
)
|
||||
return telephone
|
||||
|
||||
def clean_gpg_fingerprint(self):
|
||||
"""Format the GPG fingerprint"""
|
||||
gpg_fingerprint = self.cleaned_data.get('gpg_fingerprint', None)
|
||||
if gpg_fingerprint:
|
||||
return gpg_fingerprint.replace(' ', '').upper()
|
||||
|
||||
force = forms.BooleanField(
|
||||
label="Forcer le déménagement ?",
|
||||
initial=False,
|
||||
|
|
22
users/migrations/0074_auto_20180810_2104.py
Normal file
22
users/migrations/0074_auto_20180810_2104.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10.7 on 2018-08-10 19:04
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import django.core.validators
|
||||
from django.db import migrations, models
|
||||
import users.models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('users', '0073_auto_20180629_1614'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='adherent',
|
||||
name='gpg_fingerprint',
|
||||
field=models.CharField(blank=True, max_length=40, null=True, validators=[django.core.validators.RegexValidator('^[0-9A-F]{40}$', message='Une fingerprint GPG doit contenir 40 caractères hexadécimaux')]),
|
||||
),
|
||||
]
|
|
@ -985,6 +985,16 @@ class Adherent(User):
|
|||
blank=True,
|
||||
null=True
|
||||
)
|
||||
gpg_fingerprint = models.CharField(
|
||||
max_length=40,
|
||||
blank=True,
|
||||
null=True,
|
||||
validators=[RegexValidator(
|
||||
'^[0-9A-F]{40}$',
|
||||
message="Une fingerprint GPG doit contenir 40 "
|
||||
"caractères hexadécimaux"
|
||||
)]
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def get_instance(cls, adherentid, *_args, **_kwargs):
|
||||
|
|
|
@ -51,7 +51,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% elif not users.is_adherent %}
|
||||
<div class="panel panel-danger">
|
||||
<div class="panel-heading dashboard">Not connected</div>
|
||||
<div class="panel-body dashboard">
|
||||
<div class="panel-body dashboard">
|
||||
{% can_create Facture %}
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'cotisations:new-facture' users.id %}">
|
||||
<i class="fas fa-sign-in-alt"></i> Pay for a connexion
|
||||
|
@ -107,7 +107,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -239,6 +239,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
</a>
|
||||
{% endif %}
|
||||
</td>
|
||||
{% if users.adherent.gpg_fingerprint %}
|
||||
<th>Empreinte GPG</th>
|
||||
<td>{{ users.adherent.gpg_fingerprint }}</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
<tr>
|
||||
{% if users.shell %}
|
||||
<th>Shell</th>
|
||||
<td>{{ users.shell }}</td>
|
||||
|
|
Loading…
Reference in a new issue