Bugs
This commit is contained in:
parent
e107a2cf7a
commit
afc9c27a06
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -15,7 +15,7 @@ from django.template.loader import render_to_string
|
|||
from users.usersforms import UsersPermForm
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
from django.views.generic import CreateView
|
||||
from users.models import Profile
|
||||
from users.models import Profile, UserNotifications, UserTime
|
||||
from areas.models import Areas
|
||||
from tasks.models import Tasks
|
||||
import webcolors
|
||||
|
|
@ -1095,52 +1095,54 @@ def UserChangeMain(request, pk):
|
|||
# Method for first User-Creation-Step
|
||||
@login_required
|
||||
def NewUserFirstStep(request):
|
||||
context = {
|
||||
'active_link' : 'dasettings'
|
||||
}
|
||||
if request.method == 'POST':
|
||||
newuserform = UserNewUserForm(request.POST)
|
||||
if newuserform.is_valid():
|
||||
if(request.POST.get("sendmailnewuser")):
|
||||
msg_html = render_to_string('users/register_mail.html', {'username': newuserform.cleaned_data.get('first_name') + " " + newuserform.cleaned_data.get('last_name')})
|
||||
send_mail(request.user.profile.agency.name + ' Account', 'Hallo ' + newuserform.cleaned_data.get('first_name') + ' ' + newuserform.cleaned_data.get('last_name') + '! Bitte setzen sie sich auf https://digitale-agentur.com/password-reset/ ein Passwort.','noreply@digitale-agentur.com',[newuserform.cleaned_data.get('email')],html_message=msg_html,fail_silently=True)
|
||||
newuser = newuserform.save(commit=False)
|
||||
newuser.username = newuser.email
|
||||
newprofile = Profile(agency=request.user.profile.agency, parent=None)
|
||||
newprofile.save()
|
||||
newuser.profile = newprofile
|
||||
newuser.save()
|
||||
|
||||
context = {
|
||||
'active_link' : 'dasettings'
|
||||
}
|
||||
# USERTIME
|
||||
user_time = UserTime(user=newuser)
|
||||
user_time.save()
|
||||
# USER NOTIFICATIONS
|
||||
user_notifications = UserNotifications(user=newuser)
|
||||
user_notifications.save()
|
||||
|
||||
if request.method == 'POST':
|
||||
newuserform = UserNewUserForm(request.POST)
|
||||
if newuserform.is_valid():
|
||||
if(request.POST.get("sendmailnewuser")):
|
||||
msg_html = render_to_string('users/register_mail.html', {'username': newuserform.cleaned_data.get('first_name') + " " + newuserform.cleaned_data.get('last_name')})
|
||||
send_mail(
|
||||
request.user.profile.agency.name + ' Account',
|
||||
'Hallo ' + newuserform.cleaned_data.get('first_name') + ' ' + newuserform.cleaned_data.get('last_name') + '! Bitte setzen sie sich auf https://digitale-agentur.com/password-reset/ ein Passwort.',
|
||||
'noreply@digitale-agentur.com',
|
||||
[newuserform.cleaned_data.get('email')],
|
||||
html_message=msg_html,
|
||||
fail_silently=True,
|
||||
)
|
||||
newuser = newuserform.save(commit=False)
|
||||
newuser.username = newuser.email
|
||||
newprofile = Profile(agency=request.user.profile.agency, parent=None)
|
||||
newprofile.save()
|
||||
newuser.profile = newprofile
|
||||
newuser.save()
|
||||
newuser_id = newuser.id
|
||||
messages.success(request, f'Benutzer angelegt!')
|
||||
today = date.today()
|
||||
UserYearAbsenceInfo(agency=request.user.profile.agency, user=newuser, year=today.year).save()
|
||||
UserYearAbsenceInfo(agency=request.user.profile.agency, user=newuser, year=today.year+1).save()
|
||||
UserYearAbsenceInfo(agency=request.user.profile.agency, user=newuser, year=today.year+2).save()
|
||||
newuser.usernotifications = user_notifications
|
||||
newuser.usertime = user_time
|
||||
|
||||
getadmingroup = AgencyGroup.objects.filter(savefordel=True, is_admin=False, agency=request.user.profile.agency)
|
||||
for g in getadmingroup:
|
||||
g.group.user_set.add(newuser)
|
||||
return redirect('/dasettings/usprof/'+str(newuser_id)+'/1')
|
||||
else:
|
||||
messages.success(request, f'Daten falsch eingegeben!')
|
||||
context['newuserform'] = UserNewUserForm(request.POST)
|
||||
return render(request, 'dasettings/user_newuser_step1.html', context)
|
||||
|
||||
# Returning the data from database for normal-loading Settings
|
||||
else:
|
||||
newuserform = UserNewUserForm()
|
||||
context.update({'newuserform' : newuserform})
|
||||
newuser_id = newuser.id
|
||||
messages.success(request, f'Benutzer angelegt!')
|
||||
today = date.today()
|
||||
UserYearAbsenceInfo(agency=request.user.profile.agency, user=newuser, year=today.year).save()
|
||||
UserYearAbsenceInfo(agency=request.user.profile.agency, user=newuser, year=today.year+1).save()
|
||||
UserYearAbsenceInfo(agency=request.user.profile.agency, user=newuser, year=today.year+2).save()
|
||||
|
||||
return render(request, 'dasettings/user_newuser_step1.html', context)
|
||||
getadmingroup = AgencyGroup.objects.filter(savefordel=True, is_admin=False, agency=request.user.profile.agency)
|
||||
for g in getadmingroup:
|
||||
g.group.user_set.add(newuser)
|
||||
return redirect('/dasettings/usprof/'+str(newuser_id)+'/1')
|
||||
else:
|
||||
messages.success(request, f'Daten falsch eingegeben!')
|
||||
context['newuserform'] = UserNewUserForm(request.POST)
|
||||
return render(request, 'dasettings/user_newuser_step1.html', context)
|
||||
|
||||
# Returning the data from database for normal-loading Settings
|
||||
else:
|
||||
newuserform = UserNewUserForm()
|
||||
context.update({'newuserform' : newuserform})
|
||||
return render(request, 'dasettings/user_newuser_step1.html', context)
|
||||
|
||||
|
||||
# NEUER AGENTURVERBUND
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -19,7 +19,7 @@ class News(models.Model):
|
|||
|
||||
go_online_on = models.DateTimeField(default=timezone.now, blank=True)
|
||||
# Default date plus two weeks
|
||||
go_offline_on = models.DateTimeField(default=timezone.now()+timedelta(days=14), blank=True)
|
||||
go_offline_on = models.DateTimeField(default=timezone.now()+timedelta(days=14), blank=True, null=True)
|
||||
|
||||
last_modified_by = models.ForeignKey(User, on_delete=models.SET_NULL, null=True, related_name='news_mod_by', default=None)
|
||||
last_modified_on = models.DateTimeField(default=timezone.now, blank=True)
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -427,15 +427,16 @@ def isfreedayname(user, daytocheck):
|
|||
# RETURN ALL ABSENCE ELEMENTS FOR THAT DAY
|
||||
@register.simple_tag
|
||||
def getabscenceday(loggeduser, user, daytocheck):
|
||||
|
||||
returnstat = False
|
||||
if(loggeduser.has_perm("users.absencemanager")):
|
||||
absencedays = Absence.objects.filter(confirm_status=0, agency=user.profile.agency, user=user, start=daytocheck) | (Absence.objects.filter(confirm_status=0, agency=user.profile.agency, user=user, start__lt=daytocheck) & Absence.objects.filter(confirm_status=0, agency=user.profile.agency, user=user, end__gt=daytocheck)) | Absence.objects.filter(confirm_status=0, agency=user.profile.agency, user=user, end=daytocheck)
|
||||
else:
|
||||
absencedays = (Absence.objects.filter(agency=user.profile.agency, user=loggeduser, confirm_status=1) | Absence.objects.filter(agency=user.profile.agency, user=user, confirm_status=0)) & (Absence.objects.filter(agency=user.profile.agency, user=user, start=daytocheck) | (Absence.objects.filter(agency=user.profile.agency, user=user, start__lt=daytocheck, confirm_status=0) & Absence.objects.filter(agency=user.profile.agency, user=user, end__gt=daytocheck)) | Absence.objects.filter(agency=user.profile.agency, user=user, end=daytocheck, confirm_status=0) )
|
||||
absencedays = (Absence.objects.filter(agency=user.profile.agency, user=loggeduser, confirm_status=1) | Absence.objects.filter(agency=user.profile.agency, user=user, confirm_status=0)) & (Absence.objects.filter(agency=user.profile.agency, user=user, start=daytocheck) | (Absence.objects.filter(agency=user.profile.agency, user=user, start__lt=daytocheck, confirm_status=0) & Absence.objects.filter(agency=user.profile.agency, user=user, end__gt=daytocheck)) | Absence.objects.filter(agency=user.profile.agency, user=user, end=daytocheck, confirm_status=0)) | ((Absence.objects.filter(agency=user.profile.agency, user=user, start__lt=daytocheck, confirm_status=1) & Absence.objects.filter(agency=user.profile.agency, user=user, end__gt=daytocheck)) | Absence.objects.filter(agency=user.profile.agency, user=user, end=daytocheck, confirm_status=1))
|
||||
if(len(absencedays) > 0):
|
||||
returnstat = list(absencedays)[0]
|
||||
|
||||
print(absencedays)
|
||||
|
||||
return returnstat
|
||||
|
||||
@register.simple_tag
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -239,7 +239,7 @@
|
|||
|
||||
<div style="" class="sidebar-heading ">
|
||||
<!--<span style="float: left"><small>poweder by </small><img src="{% static 'users/img/VVE-Logo.png' %}" width="27%" class="mb-2"></span>-->
|
||||
<img src="{% static 'users/img/VVE-Logo.png' %}" width="27%" class="mb-2">
|
||||
<a href="https://www.myvve.de/" target="_blank"><img src="{% static 'users/img/VVE-Logo.png' %}" width="27%" class="mb-2"></a>
|
||||
<br />
|
||||
<a style="color: #999; text-decoration: none;" href="{% url 'datenschutzda' %}">Datenschutz</a><br />
|
||||
<a style="color: #999; text-decoration: none;" href="{% url 'impressumda' %}">Impressum</a>
|
||||
|
|
|
|||
|
|
@ -129,8 +129,6 @@
|
|||
</div>
|
||||
{% endfor %}
|
||||
|
||||
|
||||
|
||||
{% for pass in res_pass %}
|
||||
<div class="modal fade " id="infos_searchres_pass_{{pass.pk}}" tabindex="-1" role="dialog" data-backdrop="static" aria-hidden="true">
|
||||
<div class="modal-dialog " role="document">
|
||||
|
|
@ -159,7 +157,7 @@
|
|||
{% if groupchecker %}
|
||||
Name: <b>{{pass.name }}</b><br />
|
||||
Benutzername: <b/>{{pass.agpass_username }}</b><br />
|
||||
Passwort: <b/>{{pass.agpass_username }}</b><br />
|
||||
Passwort: <b/>{{pass.compass }}</b><br />
|
||||
{% else %}
|
||||
Sie dürfen keine Informationen dieses Passwortes einsehen.
|
||||
{% endif %}
|
||||
|
|
|
|||
Loading…
Reference in New Issue