Browse Source

Small tweaks after merge

Rafał Pitoń 7 years ago
parent
commit
9be7f056fb

+ 6 - 7
misago/conf/defaults.py

@@ -259,6 +259,12 @@ MISAGO_RANKING_LENGTH = 30
 MISAGO_RANKING_SIZE = 50
 
 
+# Specifies the number of days that IP addresses are stored in the database before removing.
+# Change this setting to None to never remove old IP addresses.
+
+MISAGO_IP_STORE_TIME = None
+
+
 # Controls number of users displayed on single page
 
 MISAGO_USERS_PER_PAGE = 12
@@ -344,10 +350,3 @@ MISAGO_MOMENT_JS_LOCALES = [
     'vi',
     'zh-cn', 'zh-hans', 'zh-tw',
 ]
-
-
-# Specifies the number of days that IP addresses are stored in the database before removing.
-# Change this setting to None to never remove old IP addresses.
-
-MISAGO_IP_STORE_TIME = None
-

+ 1 - 0
misago/project_template/cron.txt

@@ -9,4 +9,5 @@
 25 0 * * * python manage.py clearsessions
 25 0 * * * python manage.py clearsocial
 25 0 * * * python manage.py invalidatebans
+0 2 * * * python manage.py removeoldips
 0 1 * * * python manage.py deletemarkedusers

+ 6 - 7
misago/project_template/project_name/settings.py

@@ -381,6 +381,12 @@ MISAGO_SEARCH_CONFIG = 'simple'
 MISAGO_AVATAR_GALLERY = os.path.join(BASE_DIR, 'avatargallery')
 
 
+# Specifies the number of days that IP addresses are stored in the database before removing.
+# Change this setting to None to never remove old IP addresses.
+
+MISAGO_IP_STORE_TIME = 50
+
+
 # Profile fields
 
 MISAGO_PROFILE_FIELDS = [
@@ -409,10 +415,3 @@ MISAGO_PROFILE_FIELDS = [
         ],
     },
 ]
-
-
-# Specifies the number of days that IP addresses are stored in the database before removing.
-# Change this setting to None to never remove old IP addresses.
-
-MISAGO_IP_STORE_TIME = 50
-

+ 4 - 2
misago/users/management/commands/removeoldips.py

@@ -7,7 +7,7 @@ from misago.users.signals import remove_old_ips
 
 
 class Command(BaseCommand):
-    help =  "Removes users IPs stored for longer than set in MISAGO_IP_STORE_TIME."
+    help = "Removes users IPs stored for longer than set in MISAGO_IP_STORE_TIME."
     
     def handle(self, *args, **options):
       if not settings.MISAGO_IP_STORE_TIME:
@@ -15,5 +15,7 @@ class Command(BaseCommand):
         return
       
       remove_old_ips.send(sender=self)
-      self.stdout.write("IP addresses older than {} days have been removed.".format(settings.MISAGO_IP_STORE_TIME))
+      
+      self.stdout.write(
+        "IP addresses older than {} days have been removed.".format(settings.MISAGO_IP_STORE_TIME))