Commit 02d94148 authored by Lukas Burgey's avatar Lukas Burgey
Browse files

Adapt some details for django 2.0 upgrade

parent aa512383
...@@ -29,9 +29,10 @@ def _api_error_response(): ...@@ -29,9 +29,10 @@ def _api_error_response():
# Response for StateView, LogoutView, and all post requests # Response for StateView, LogoutView, and all post requests
def _api_state_response(request): def _api_state_response(request):
response = { response = {
'logged_in': request.user.is_authenticated() 'logged_in': request.user.is_authenticated
} }
if request.user.is_authenticated(): if request.user.is_authenticated:
response['user'] = serializers.UserSerializer(request.user).data response['user'] = serializers.UserSerializer(request.user).data
......
...@@ -318,9 +318,12 @@ class SSHPublicKey(models.Model): ...@@ -318,9 +318,12 @@ class SSHPublicKey(models.Model):
max_length=1000 max_length=1000
) )
# hidden field at the user # hidden field at the user
# TODO checks: if the user is null
user = models.ForeignKey( user = models.ForeignKey(
User, User,
related_name='_ssh_keys', related_name='_ssh_keys',
on_delete=models.SET_NULL,
null=True,
) )
# has the user triggered the deletion of this key # has the user triggered the deletion of this key
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment