Skip to content

Commit

Permalink
Merge branch 'master' into new-huisstijl
Browse files Browse the repository at this point in the history
  • Loading branch information
JoepdeJong authored Oct 12, 2023
2 parents c25a01c + 8252a76 commit d224804
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 70 deletions.
1 change: 0 additions & 1 deletion ldb/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,6 @@ class PersonAdmin(ImportExportVersionModelAdmin):
"fields": [
"ldap_username",
"google_username",
"email_forward",
"netid",
"linkedin_id",
"facebook_id",
Expand Down
2 changes: 0 additions & 2 deletions ldb/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def render(self, data, media_type=None, renderer_context=None):
"person__gender",
"person__pronouns",
"person__birthdate",
"person__email_forward",
"person__ldap_username",
"person__google_username",
"person__netid",
Expand Down Expand Up @@ -144,7 +143,6 @@ def get(self, request):
"gender",
"pronouns",
"birthdate",
"email_forward",
"ldap_username",
"google_username",
"netid",
Expand Down
16 changes: 16 additions & 0 deletions ldb/migrations/0024_remove_person_email_forward.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Generated by Django 4.2.6 on 2023-10-12 09:01

from django.db import migrations


class Migration(migrations.Migration):
dependencies = [
("ldb", "0023_alter_entity_country"),
]

operations = [
migrations.RemoveField(
model_name="person",
name="email_forward",
),
]
27 changes: 0 additions & 27 deletions ldb/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,6 @@ class Meta:
_("Google username"), max_length=64, blank=True, null=True, unique=True
)

email_forward = models.BooleanField(
_("forward CH e-mail to Dienst2 e-mail"), default=False
)

# External Accounts
netid = models.CharField(
_("NetID"), max_length=64, blank=True, null=True, unique=True
Expand Down Expand Up @@ -314,29 +310,6 @@ def age(self):
else:
return today.year - born.year

def clean(self):
if self.email_forward:
if self.ldap_username is None:
raise ValidationError(
{
"email_forward": _(
"LDAP username must be set to enable forwarding."
)
}
)
if self.email == "":
raise ValidationError(
{"email_forward": _("E-mail must be set to enable forwarding.")}
)
if self.email.endswith("ch.tudelft.nl"):
raise ValidationError(
{
"email_forward": _(
"E-mail cannot be forwarded to a CH e-mail address."
)
}
)

def save(self, **kwargs):
self._membership_status = self.membership_status

Expand Down
1 change: 0 additions & 1 deletion ldb/static/partials/export.html
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@ <h1>3. Velden</h1>
<div class="checkbox"><label class=""><input type="checkbox" ng-model="export.fields.person__gender"> Geslacht</label></div>
<div class="checkbox"><label class=""><input type="checkbox" ng-model="export.fields.person__pronouns"> Voornaamwoorden</label></div>
<div class="checkbox"><label class=""><input type="checkbox" ng-model="export.fields.person__birthdate"> Geboortedatum</label></div>
<div class="checkbox"><label class=""><input type="checkbox" ng-model="export.fields.person__email_forward"> Email forward</label></div>
<div class="checkbox"><label class=""><input type="checkbox" ng-model="export.fields.person__ldap_username"> LDAP-gebruikersnaam</label></div>
<div class="checkbox"><label class=""><input type="checkbox" ng-model="export.fields.person__google_username"> Google-gebruikersnaam</label></div>
<div class="checkbox"><label class=""><input type="checkbox" ng-model="export.fields.person__netid"> NetID</label></div>
Expand Down
6 changes: 0 additions & 6 deletions ldb/templates/ldb/person_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,6 @@ <h2 class="page-header">
<div class="col-sm-8">
<p class="form-control-static">
{{ person.ldap_username }}
{% if person.email_forward %}
<br/><small>
{% blocktrans trimmed with username=person.ldap_username email=person.email %}
E-mail to {{ username }}@ch.tudelft.nl is forwarded to {{ email }}.
{% endblocktrans %}</small>
{% endif %}
</p>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion ldb/templates/ldb/person_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ <h2 class="page-header">Persoon aanmaken</h2>

<fieldset>
<legend>Overige</legend>
{% get_fieldset gender,pronouns,birthdate,deceased,ldap_username,google_username,email_forward,comment,netid,facebook_id,linkedin_id as other_fields from form %}
{% get_fieldset gender,pronouns,birthdate,deceased,ldap_username,google_username,comment,netid,facebook_id,linkedin_id as other_fields from form %}
{% bootstrap_form other_fields layout='horizontal' %}
</fieldset>

Expand Down
74 changes: 42 additions & 32 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d224804

Please sign in to comment.