Skip to content

Commit

Permalink
linter fix
Browse files Browse the repository at this point in the history
  • Loading branch information
BenediktMKuehne committed Nov 17, 2023
1 parent db798ab commit b9f046f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion embark/templates/user/timezone.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% load tz %}
{% get_current_timezone as TIME_ZONE %}
<form action="{% url 'embark-acc-timezone' %}" method="POST">
<form action="{% url 'embark-acc-timezone' %}" method="post">
{% csrf_token %}
<label for="timezone">Time zone:</label>
<select name="timezone">
Expand Down
5 changes: 2 additions & 3 deletions embark/uploader/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,15 +383,14 @@ def get_flags(self):
# running emba
logger.info("final emba parameters %s", command)
return command

def do_archive(self):
"""
cleans up the firmwareanalysis log_dir up to a point where it's minimal
TODO since it's only deletes we don't need it to be in boundedexec
"""
logger.info("Archiving %s", self.id)
logger.debug("Function not implemented yet. %s stays the same", self.id)
pass


@receiver(pre_delete, sender=FirmwareAnalysis)
Expand All @@ -412,7 +411,7 @@ def delete_analysis_pre_delete(sender, instance, **kwargs):
else:
pass
except builtins.Exception as _error:
logger.error("Error durring delete of: %s - %s", str(sender),_error)
logger.error("Error durring delete of: %s - %s", str(sender), _error)


class ResourceTimestamp(models.Model):
Expand Down
4 changes: 2 additions & 2 deletions embark/users/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

urlpatterns = [
path(settings.LOGIN_URL, views.embark_login, name='embark-login'),
path('user/',views.user_main, name='embark-user-main'),
path('user/', views.user_main, name='embark-user-main'),
path('register/', views.register, name='embark-register'),
path('logout/', views.embark_logout, name='embark-logout'),
path('user/password_change/', views.password_change, name='embark-password-change'),
path('user/acc_delete/', views.acc_delete, name='embark-acc-delete'),
path('user/set_timezone/', views.set_timezone, name='embark-acc-timezone'),\
path('user/set_timezone/', views.set_timezone, name='embark-acc-timezone'),
# TODO account menu path('my-account/', views., name='embark-), for admin options etc
path('log/<int:log_type>/<int:lines>/', views.get_log, name='log'),
]
7 changes: 4 additions & 3 deletions embark/users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from datetime import datetime

from django.contrib.auth.decorators import login_required
from django.http import HttpResponseRedirect
from django.shortcuts import render, redirect
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_http_methods
Expand All @@ -17,12 +16,13 @@

logger = logging.getLogger(__name__)


@require_http_methods(["GET"])
def user_main(request):
logger.debug("Account settings for %s",request.user)

logger.debug("Account settings for %s", request.user)
return render(request, 'user/index.html', {"timezones": settings.TIMEZONES})


@csrf_exempt
@require_http_methods(["GET", "POST"])
def register(request):
Expand Down Expand Up @@ -214,6 +214,7 @@ def get_log(request, log_type, lines): # FIXME update or remove
except IOError:
return render(request, 'user/log.html', {'header': 'Error', 'log': file_path + ' not found!', 'username': request.user.username})


@require_http_methods(["POST"])
@login_required(login_url='/' + settings.LOGIN_URL)
def set_timezone(request):
Expand Down

0 comments on commit b9f046f

Please sign in to comment.