mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-08-20 14:13:41 +00:00
Forbid user from forcing out another user with a free access
This commit is contained in:
parent
ae7f1aaf38
commit
86813b1a47
2 changed files with 21 additions and 1 deletions
20
preferences/migrations/0069_auto_20200415_2012.py
Normal file
20
preferences/migrations/0069_auto_20200415_2012.py
Normal 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.'),
|
||||
),
|
||||
]
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue