tBKwtWS 6 jaren geleden
bovenliggende
commit
c1b7cf9065
3 gewijzigde bestanden met toevoegingen van 22 en 3 verwijderingen
  1. 3 2
      rotbot/common/queries.py
  2. 18 0
      website/rotbot/migrations/0004_auto_20191119_0418.py
  3. 1 1
      website/rotbot/models.py

+ 3 - 2
rotbot/common/queries.py

@@ -91,8 +91,8 @@ def create_or_get_and_update_last_event(self, table, event_type, channel_name=No
                 chat=False,
             )
         else:
-            fields += ', xp_spent, level, coin, coin_given, coin_spent, ap_spent, karma_correction, no_chat'
-            values += ', %(xp_spent)s, %(level)s, %(coin)s, %(coin_given)s, %(coin_spent)s, %(ap_spent)s, %(karma_correction)s, %(no_chat)s'
+            fields += ', xp_spent, level, coin, coin_given, coin_spent, ap_spent, karma_correction, xp_correction, no_chat'
+            values += ', %(xp_spent)s, %(level)s, %(coin)s, %(coin_given)s, %(coin_spent)s, %(ap_spent)s, %(karma_correction)s, %(xp_correction)s, %(no_chat)s'
             self.db.run(    # Create record.
                 'INSERT INTO rotbot_' + table + ' (' + fields + ') VALUES (' + values + ')',
                 name=name,
@@ -110,6 +110,7 @@ def create_or_get_and_update_last_event(self, table, event_type, channel_name=No
                 coin_spent=0,
                 ap_spent=0,
                 karma_correction=0,
+                xp_correction=0,
                 no_chat=False,
             )
         record = self.db.one('SELECT * FROM rotbot_' + table + ' WHERE slug=%(slug)s', slug=new_slug)   # Lookup newly created record to return to call..

+ 18 - 0
website/rotbot/migrations/0004_auto_20191119_0418.py

@@ -0,0 +1,18 @@
+# Generated by Django 2.2.6 on 2019-11-19 03:18
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('rotbot', '0003_auto_20191119_0406'),
+    ]
+
+    operations = [
+        migrations.RenameField(
+            model_name='user',
+            old_name='xp_corrention',
+            new_name='xp_correction',
+        ),
+    ]

+ 1 - 1
website/rotbot/models.py

@@ -295,7 +295,7 @@ class User(models.Model):
     karma_correction = models.PositiveIntegerField(
         default=0,
     )
-    xp_corrention = models.PositiveIntegerField(
+    xp_correction = models.PositiveIntegerField(
         default=0,
     )
     no_chat = models.BooleanField(