Merge branch 'master' into feature_deletion_system
This commit is contained in:
commit
815fff4094
@ -1,6 +1,6 @@
|
|||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from .models import Realm, DeletedUser
|
from .models import Realm
|
||||||
|
|
||||||
# Register your models here.
|
# Register your models here.
|
||||||
admin.site.register(Realm)
|
admin.site.register(Realm)
|
||||||
admin.site.register(DeletedUser)
|
# admin.site.register(DeletedUser)
|
||||||
|
|||||||
@ -14,16 +14,3 @@ class Realm(models.Model):
|
|||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f'{self.name} - {self.ldap_base_dn}'
|
return f'{self.name} - {self.ldap_base_dn}'
|
||||||
|
|
||||||
|
|
||||||
def get_deletion_time():
|
|
||||||
return timezone.now() + timezone.timedelta(+14)
|
|
||||||
|
|
||||||
|
|
||||||
class DeletedUser(models.Model):
|
|
||||||
deletion_marker_date = models.DateField(auto_now_add=True)
|
|
||||||
user = models.ForeignKey(User, on_delete=models.CASCADE)
|
|
||||||
ldap_dn = models.CharField(max_length=512, unique=True)
|
|
||||||
deletion_date = models.DateField(default=get_deletion_time)
|
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return f'{self.user.username} - {self.deletion_marker_date} - {self.deletion_date} - {self.ldap_dn}'
|
|
||||||
|
|||||||
@ -13,7 +13,7 @@ from django.shortcuts import render, redirect
|
|||||||
from django.utils.translation import gettext as _
|
from django.utils.translation import gettext as _
|
||||||
from ldap import ALREADY_EXISTS, OBJECT_CLASS_VIOLATION
|
from ldap import ALREADY_EXISTS, OBJECT_CLASS_VIOLATION
|
||||||
|
|
||||||
from account_helper.models import Realm, DeletedUser
|
from account_helper.models import Realm
|
||||||
from account_manager.forms import AddLDAPUserForm, UserDeleteListForm, UpdateLDAPUserForm, AdminUpdateLDAPUserForm, \
|
from account_manager.forms import AddLDAPUserForm, UserDeleteListForm, UpdateLDAPUserForm, AdminUpdateLDAPUserForm, \
|
||||||
UserGroupListForm
|
UserGroupListForm
|
||||||
from account_manager.main_views import is_realm_admin
|
from account_manager.main_views import is_realm_admin
|
||||||
|
|||||||
@ -128,10 +128,20 @@
|
|||||||
/*!*visibility: hidden*!*/
|
/*!*visibility: hidden*!*/
|
||||||
/*}*/
|
/*}*/
|
||||||
|
|
||||||
|
.data-table {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
.paginate_button {
|
.paginate_button {
|
||||||
padding: 0px 2px
|
padding: 0px 2px
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.paginate_button.current {
|
||||||
|
font-size: 1.4em;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@media (max-width: 480px) {
|
@media (max-width: 480px) {
|
||||||
.table-search-field {
|
.table-search-field {
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
|
|||||||
@ -26,9 +26,9 @@ $(document).ready(function () {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
rowReorder: {
|
rowReorder: {
|
||||||
selector: true,
|
selector: 'td:nth-child(2)'
|
||||||
},
|
},
|
||||||
responsive: true,
|
responsive: true
|
||||||
});
|
});
|
||||||
$('#data-table-search-input').keyup(function () {
|
$('#data-table-search-input').keyup(function () {
|
||||||
data_table.search($(this).val()).draw();
|
data_table.search($(this).val()).draw();
|
||||||
|
|||||||
@ -39,7 +39,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if request.user.is_superuser %}
|
{% if request.user.is_superuser %}
|
||||||
<div class="list-group-flush border-top">
|
<div class="list-group-flush border-top mb-5">
|
||||||
<div class="list-group-item bg-light border-0"></div>
|
<div class="list-group-item bg-light border-0"></div>
|
||||||
<a href="{{ url('realm-add') }}"
|
<a href="{{ url('realm-add') }}"
|
||||||
class="list-group-item list-group-item-action bg-light"><i class="fas fa-plus-square"></i>
|
class="list-group-item list-group-item-action bg-light"><i class="fas fa-plus-square"></i>
|
||||||
|
|||||||
@ -55,12 +55,11 @@
|
|||||||
<a href="{{ url('realm-update', args=[realm.id]) }}" class="btn btn-primary mr-auto p-2"><i
|
<a href="{{ url('realm-update', args=[realm.id]) }}" class="btn btn-primary mr-auto p-2"><i
|
||||||
class="fas fa-info-circle"></i> Bereichsinformationen
|
class="fas fa-info-circle"></i> Bereichsinformationen
|
||||||
anpassen</a>
|
anpassen</a>
|
||||||
{% endif %}
|
|
||||||
{# <a href="{{ url('realm-mail-add-update', args=[realm.id]) }}" class="btn btn-primary p-2">E-Mail#}
|
{% if realm.email %}
|
||||||
{# Einstellungen</a>#}
|
<a href="{{ url('realm-mail-test', args=[realm.id]) }}" class="btn btn-secondary p-2"><i
|
||||||
{% if realm.email %}
|
class="fas fa-paper-plane"></i> Test Mail</a>
|
||||||
<a href="{{ url('realm-mail-test', args=[realm.id]) }}" class="btn btn-secondary p-2"><i
|
{% endif %}
|
||||||
class="fas fa-paper-plane"></i> Test Mail</a>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% block realm_form %}
|
{% block realm_form %}
|
||||||
|
|||||||
Reference in New Issue
Block a user