mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-10 21:10:17 +02:00
[FIX] Use of deprecated logger.warn()
function calls
This commit is contained in:
parent
f2c43ee921
commit
d57ab01ff3
@ -57,7 +57,7 @@ def hr_application_create_view(request, form_id=None):
|
|||||||
app_form = get_object_or_404(ApplicationForm, id=form_id)
|
app_form = get_object_or_404(ApplicationForm, id=form_id)
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
if Application.objects.filter(user=request.user).filter(form=app_form).exists():
|
if Application.objects.filter(user=request.user).filter(form=app_form).exists():
|
||||||
logger.warn(f"User {request.user} attempting to duplicate application to {app_form.corp}")
|
logger.warning(f"User {request.user} attempting to duplicate application to {app_form.corp}")
|
||||||
else:
|
else:
|
||||||
application = Application(user=request.user, form=app_form)
|
application = Application(user=request.user, form=app_form)
|
||||||
application.save()
|
application.save()
|
||||||
@ -92,7 +92,7 @@ def hr_application_personal_view(request, app_id):
|
|||||||
}
|
}
|
||||||
return render(request, 'hrapplications/view.html', context=context)
|
return render(request, 'hrapplications/view.html', context=context)
|
||||||
else:
|
else:
|
||||||
logger.warn(f"User {request.user} not authorized to view {app}")
|
logger.warning(f"User {request.user} not authorized to view {app}")
|
||||||
return redirect('hrapplications:personal_view')
|
return redirect('hrapplications:personal_view')
|
||||||
|
|
||||||
|
|
||||||
@ -105,9 +105,9 @@ def hr_application_personal_removal(request, app_id):
|
|||||||
logger.info(f"User {request.user} deleting {app}")
|
logger.info(f"User {request.user} deleting {app}")
|
||||||
app.delete()
|
app.delete()
|
||||||
else:
|
else:
|
||||||
logger.warn(f"User {request.user} attempting to delete reviewed app {app}")
|
logger.warning(f"User {request.user} attempting to delete reviewed app {app}")
|
||||||
else:
|
else:
|
||||||
logger.warn(f"User {request.user} not authorized to delete {app}")
|
logger.warning(f"User {request.user} not authorized to delete {app}")
|
||||||
return redirect('hrapplications:index')
|
return redirect('hrapplications:index')
|
||||||
|
|
||||||
|
|
||||||
@ -132,7 +132,7 @@ def hr_application_view(request, app_id):
|
|||||||
logger.info(f"Saved comment by user {request.user} to {app}")
|
logger.info(f"Saved comment by user {request.user} to {app}")
|
||||||
return redirect('hrapplications:view', app_id)
|
return redirect('hrapplications:view', app_id)
|
||||||
else:
|
else:
|
||||||
logger.warn("User %s does not have permission to add ApplicationComments" % request.user)
|
logger.warning("User %s does not have permission to add ApplicationComments" % request.user)
|
||||||
return redirect('hrapplications:view', app_id)
|
return redirect('hrapplications:view', app_id)
|
||||||
else:
|
else:
|
||||||
logger.debug("Returning blank HRApplication comment form.")
|
logger.debug("Returning blank HRApplication comment form.")
|
||||||
@ -171,7 +171,7 @@ def hr_application_approve(request, app_id):
|
|||||||
app.save()
|
app.save()
|
||||||
notify(app.user, "Application Accepted", message="Your application to %s has been approved." % app.form.corp, level="success")
|
notify(app.user, "Application Accepted", message="Your application to %s has been approved." % app.form.corp, level="success")
|
||||||
else:
|
else:
|
||||||
logger.warn(f"User {request.user} not authorized to approve {app}")
|
logger.warning(f"User {request.user} not authorized to approve {app}")
|
||||||
return redirect('hrapplications:index')
|
return redirect('hrapplications:index')
|
||||||
|
|
||||||
|
|
||||||
@ -187,7 +187,7 @@ def hr_application_reject(request, app_id):
|
|||||||
app.save()
|
app.save()
|
||||||
notify(app.user, "Application Rejected", message="Your application to %s has been rejected." % app.form.corp, level="danger")
|
notify(app.user, "Application Rejected", message="Your application to %s has been rejected." % app.form.corp, level="danger")
|
||||||
else:
|
else:
|
||||||
logger.warn(f"User {request.user} not authorized to reject {app}")
|
logger.warning(f"User {request.user} not authorized to reject {app}")
|
||||||
return redirect('hrapplications:index')
|
return redirect('hrapplications:index')
|
||||||
|
|
||||||
|
|
||||||
@ -208,7 +208,7 @@ def hr_application_search(request):
|
|||||||
app_list = app_list.filter(
|
app_list = app_list.filter(
|
||||||
form__corp__corporation_id=request.user.profile.main_character.corporation_id)
|
form__corp__corporation_id=request.user.profile.main_character.corporation_id)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
logger.warn(
|
logger.warning(
|
||||||
"User %s missing main character model: unable to filter applications to search" % request.user)
|
"User %s missing main character model: unable to filter applications to search" % request.user)
|
||||||
|
|
||||||
applications = app_list.filter(
|
applications = app_list.filter(
|
||||||
@ -246,6 +246,6 @@ def hr_application_mark_in_progress(request, app_id):
|
|||||||
app.save()
|
app.save()
|
||||||
notify(app.user, "Application In Progress", message=f"Your application to {app.form.corp} is being reviewed by {app.reviewer_str}")
|
notify(app.user, "Application In Progress", message=f"Your application to {app.form.corp} is being reviewed by {app.reviewer_str}")
|
||||||
else:
|
else:
|
||||||
logger.warn(
|
logger.warning(
|
||||||
f"User {request.user} unable to mark {app} in progress: already being reviewed by {app.reviewer}")
|
f"User {request.user} unable to mark {app} in progress: already being reviewed by {app.reviewer}")
|
||||||
return redirect("hrapplications:view", app_id)
|
return redirect("hrapplications:view", app_id)
|
||||||
|
@ -44,7 +44,7 @@ def notification_view(request, notif_id):
|
|||||||
notif.mark_viewed()
|
notif.mark_viewed()
|
||||||
return render(request, 'notifications/view.html', context)
|
return render(request, 'notifications/view.html', context)
|
||||||
else:
|
else:
|
||||||
logger.warn(
|
logger.warning(
|
||||||
"User %s not authorized to view notif_id %s belonging to user %s",
|
"User %s not authorized to view notif_id %s belonging to user %s",
|
||||||
request.user,
|
request.user,
|
||||||
notif_id, notif.user
|
notif_id, notif.user
|
||||||
|
@ -49,7 +49,7 @@ class DiscourseTasks:
|
|||||||
DiscourseManager.update_groups(user)
|
DiscourseManager.update_groups(user)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.exception(e)
|
logger.exception(e)
|
||||||
logger.warn("Discourse group sync failed for %s, retrying in 10 mins" % user)
|
logger.warning("Discourse group sync failed for %s, retrying in 10 mins" % user)
|
||||||
raise self.retry(countdown=60 * 10)
|
raise self.retry(countdown=60 * 10)
|
||||||
logger.debug("Updated user %s discourse groups." % user)
|
logger.debug("Updated user %s discourse groups." % user)
|
||||||
|
|
||||||
|
@ -176,7 +176,7 @@ class Phpbb3Manager:
|
|||||||
logger.debug(f"Proceeding to add phpbb user {username_clean} and pwhash starting with {pwhash[0:5]}")
|
logger.debug(f"Proceeding to add phpbb user {username_clean} and pwhash starting with {pwhash[0:5]}")
|
||||||
# check if the username was simply revoked
|
# check if the username was simply revoked
|
||||||
if Phpbb3Manager.check_user(username_clean):
|
if Phpbb3Manager.check_user(username_clean):
|
||||||
logger.warn("Unable to add phpbb user with username %s - already exists. Updating user instead." % username)
|
logger.warning("Unable to add phpbb user with username %s - already exists. Updating user instead." % username)
|
||||||
Phpbb3Manager.__update_user_info(username_clean, email, pwhash)
|
Phpbb3Manager.__update_user_info(username_clean, email, pwhash)
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
|
@ -44,7 +44,7 @@ def activate_teamspeak3(request):
|
|||||||
def verify_teamspeak3(request):
|
def verify_teamspeak3(request):
|
||||||
logger.debug("verify_teamspeak3 called by user %s" % request.user)
|
logger.debug("verify_teamspeak3 called by user %s" % request.user)
|
||||||
if not Teamspeak3Tasks.has_account(request.user):
|
if not Teamspeak3Tasks.has_account(request.user):
|
||||||
logger.warn("Unable to validate user %s teamspeak: no teamspeak data" % request.user)
|
logger.warning("Unable to validate user %s teamspeak: no teamspeak data" % request.user)
|
||||||
return redirect("services:services")
|
return redirect("services:services")
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
form = TeamspeakJoinForm(request.POST)
|
form = TeamspeakJoinForm(request.POST)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user