Skip to content

Commit

Permalink
Merge pull request #100 from gerosecurity/development
Browse files Browse the repository at this point in the history
Bug Fix
  • Loading branch information
VGR6479 authored Jul 11, 2024
2 parents 58d22d6 + ec4f358 commit 738924c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 19 deletions.
38 changes: 21 additions & 17 deletions gerobug_dashboard/dashboards/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,22 @@ def AdminSetting(request):
logging.getLogger("Gerologger").info("Company Identity updated successfully")
messages.success(request,"Company Identity updated successfully!")
return redirect('setting')


personalization = PersonalizationForm(request.POST)
if personalization.is_valid():
theme = Personalization.objects.get(personalize_id=1)
theme.main_1 = personalization.cleaned_data.get('main_1')
theme.main_2 = personalization.cleaned_data.get('main_2')
theme.secondary_1 = personalization.cleaned_data.get('secondary_1')
theme.secondary_2 = personalization.cleaned_data.get('secondary_2')
theme.secondary_3 = personalization.cleaned_data.get('secondary_3')
theme.button_1 = personalization.cleaned_data.get('button_1')
theme.save()

logging.getLogger("Gerologger").info("Personalization updated successfully")
messages.success(request,"Personalization updated successfully!")
return redirect('setting')

troubleshoot = TroubleshootForm(request.POST)
if troubleshoot.is_valid():
if troubleshoot.cleaned_data.get('troubleshoot_1') == True:
Expand Down Expand Up @@ -560,21 +575,6 @@ def trigger_recovery(report_name, id, type):
logging.getLogger("Gerologger").info("Troubleshoot Executed: RECOVER LOSS REPORT FILES")

return redirect("setting")

personalization = PersonalizationForm(request.POST)
if personalization.is_valid():
theme = Personalization.objects.get(personalize_id=1)
theme.main_1 = personalization.cleaned_data.get('main_1')
theme.main_2 = personalization.cleaned_data.get('main_2')
theme.secondary_1 = personalization.cleaned_data.get('secondary_1')
theme.secondary_2 = personalization.cleaned_data.get('secondary_2')
theme.secondary_3 = personalization.cleaned_data.get('secondary_3')
theme.button_1 = personalization.cleaned_data.get('button_1')
theme.save()

logging.getLogger("Gerologger").info("Personalization updated successfully")
messages.success(request,"Personalization updated successfully!")
return redirect('setting')

THEME = Personalization.objects.get(personalize_id=1)
RULES = StaticRules.objects.get(pk=1)
Expand All @@ -590,12 +590,16 @@ def ReviewerDelete(request,id):
if User.objects.filter(id=id).count() != 0:
User.objects.filter(id=id).delete()
messages.success(request,"User is deleted successfully!")
return redirect('setting')
logging.getLogger("Gerologger").info("USER ID " + str(id) + " SUCCESSFULLY DELETED BY " + str(request.user.username))
return redirect('dashboard')

except Exception as e:
logging.getLogger("Gerologger").error(str(e))
messages.error(request,"Something wrong. The delete operation is unsuccessful. Please report to the Admin!")
return redirect('setting')

return redirect('setting')

return render(request,'setting.html')

@login_required
Expand Down
2 changes: 1 addition & 1 deletion gerobug_dashboard/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ django-bleach
django-colorfield==0.10.1
django-crispy-forms
django-quill-editor
django==4.2.11
django==5.0.7
gunicorn==22.0.0
libmagic
psycopg2
Expand Down
2 changes: 1 addition & 1 deletion gerobug_web/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
django-bleach
django-colorfield==0.10.1
django-quill-editor
django==4.2.11
django==5.0.7
gunicorn==22.0.0
psycopg2

0 comments on commit 738924c

Please sign in to comment.