diff --git a/coopeV3/templatetags/vip.py b/coopeV3/templatetags/vip.py
index 3d49afa..436cb03 100644
--- a/coopeV3/templatetags/vip.py
+++ b/coopeV3/templatetags/vip.py
@@ -39,3 +39,9 @@ def global_message():
gp,_ = GeneralPreferences.objects.get_or_create(pk=1)
messages = gp.global_message.split("\n")
return random.choice(messages)
+
+@register.simple_tag
+def logout_time():
+ gp, _ = GeneralPreferences.objects.get_or_create(pk=1)
+ logout_time = gp.automatic_logout_time
+ return logout_time
\ No newline at end of file
diff --git a/preferences/migrations/0007_auto_20190120_1208.py b/preferences/migrations/0007_auto_20190120_1208.py
new file mode 100644
index 0000000..18d808a
--- /dev/null
+++ b/preferences/migrations/0007_auto_20190120_1208.py
@@ -0,0 +1,23 @@
+# Generated by Django 2.1 on 2019-01-20 11:08
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('preferences', '0006_auto_20190119_2326'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='generalpreferences',
+ name='automatic_logout_time',
+ field=models.PositiveIntegerField(null=True),
+ ),
+ migrations.AddField(
+ model_name='historicalgeneralpreferences',
+ name='automatic_logout_time',
+ field=models.PositiveIntegerField(null=True),
+ ),
+ ]
diff --git a/preferences/models.py b/preferences/models.py
index e5eada9..f4d1ce6 100644
--- a/preferences/models.py
+++ b/preferences/models.py
@@ -35,6 +35,7 @@ class GeneralPreferences(models.Model):
lost_pintes_allowed = models.PositiveIntegerField(default=0)
floating_buttons = models.BooleanField(default=False)
home_text = models.TextField(blank=True)
+ automatic_logout_time = models.PositiveIntegerField(null=True)
history = HistoricalRecords()
class Cotisation(models.Model):
diff --git a/preferences/templates/preferences/general_preferences.html b/preferences/templates/preferences/general_preferences.html
index 44acc57..5c1e047 100644
--- a/preferences/templates/preferences/general_preferences.html
+++ b/preferences/templates/preferences/general_preferences.html
@@ -136,6 +136,14 @@
+