8
0
Fork 0
mirror of https://gitlab.federez.net/re2o/re2o synced 2024-05-18 16:43:11 +00:00

Forbid user from forcing out another user with a free access

This commit is contained in:
Jean-Romain Garnier 2020-04-15 18:42:36 +00:00 committed by Gabriel Detraz
parent e417de379e
commit c14f172764
2 changed files with 21 additions and 1 deletions

View file

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.28 on 2020-04-15 18:12
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('preferences', '0068_optionaluser_self_force_move_disabled_user_room'),
]
operations = [
migrations.AlterField(
model_name='optionaluser',
name='self_force_move_disabled_user_room',
field=models.BooleanField(default=False, help_text='Users can select a room occupied by a user with a disabled connection.'),
),
]

View file

@ -366,7 +366,7 @@ class AdherentForm(FormRevMixin, FieldPermissionFormMixin, ModelForm):
# If a user already is register for this room
# but their connection has expired, allow force move
user = Adherent.objects.get(room=room)
if user and not user.is_connected():
if user and not user.has_access():
remove_user_room(room)
except Adherent.DoesNotExist:
pass