Upgrades and removals.
authorRadek Czajka <rczajka@rczajka.pl>
Thu, 6 Oct 2022 09:24:51 +0000 (11:24 +0200)
committerRadek Czajka <rczajka@rczajka.pl>
Thu, 6 Oct 2022 09:24:51 +0000 (11:24 +0200)
requirements/requirements.txt
src/funding/migrations/0009_move_from_getpaid.py
src/wolnelektury/migrations/__init__.py [deleted file]
src/wolnelektury/migrations/getpaid/0001_initial.py [deleted file]
src/wolnelektury/migrations/getpaid/0002_auto_20151221_1225.py [deleted file]
src/wolnelektury/migrations/getpaid/__init__.py [deleted file]
src/wolnelektury/settings/apps.py
src/wolnelektury/settings/contrib.py

index 8d59703..fa2d531 100644 (file)
@@ -20,7 +20,7 @@ django-machina==1.1.6
 django-countries==7.3.2
 
 # A version compatible with Django 2.2, with long help text and editable max_length.
--e git+https://github.com/rczajka/django-forms-builder@8ec4022f2a185658b4b23c3d020e0d5c3cb88774#egg=django-forms-builder
+-e git+https://github.com/rczajka/django-forms-builder@6bdb2345cfc02ebf7e0fb049e43e4e0a38b52940#egg=django-forms-builder
 
 
 oauthlib>=3.0.1,<3.1
@@ -47,16 +47,12 @@ sorl-thumbnail==12.7.0
 librarian==2.4.1
 
 # celery tasks
-celery[redis]==4.4.7
+celery[redis]==5.2.7
 
 # OAI-PMH
 pyoai==2.5.0
 
 scorched==0.13
-
-django-getpaid==1.8.0
-deprecated
-
 httplib2
 
 sentry-sdk==0.10.2
index 2beeb24..1bc2a4d 100644 (file)
@@ -3,42 +3,17 @@ from django.conf import settings
 from django.db import migrations
 
 
-def move_from_getpaid(apps, schema_editor):
-    try:
-        G = settings.GETPAID_BACKENDS_SETTINGS
-    except AttributeError:
-        G = {}
-        getpaid_conf = False
-    else:
-        getpaid_conf = True
-
-    Funding = apps.get_model('funding', 'Funding')
-    for f in Funding.objects.filter(status=''):
-        payment = f.payment.first()
-        # TODO: what happens when no payments any more?
-        if payment is None:
-            continue
-        f.created_at = payment.created_on
-        f.order_id = payment.external_id
-        f.pos_id = G.get(payment.backend, {}).get('pos_id', '')
-        assert getpaid_conf, 'Getpaid configuration removed prematurely.'
-        f.status = {
-            'paid': 'COMPLETED',
-            'failed': 'REJECTED',
-            'in_progress': 'CANCELLED',
-        }[payment.status]
-        f.save()
-
-
 class Migration(migrations.Migration):
 
     dependencies = [
         ('funding', '0008_auto_20221003_1235'),
     ]
 
+    # migration intentionally left empty
     operations = [
         migrations.RunPython(
-            move_from_getpaid,
-            migrations.RunPython.noop
+            migrations.RunPython.noop,
+            migrations.RunPython.noop,
+            elidable=True
         )
     ]
diff --git a/src/wolnelektury/migrations/__init__.py b/src/wolnelektury/migrations/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/src/wolnelektury/migrations/getpaid/0001_initial.py b/src/wolnelektury/migrations/getpaid/0001_initial.py
deleted file mode 100644 (file)
index 7e0d66c..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
-# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
-#
-from django.db import models, migrations
-import django.db.models.deletion
-import getpaid.abstract_mixin
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('funding', '0001_initial'),
-    ]
-
-    operations = [
-        migrations.CreateModel(
-            name='Payment',
-            fields=[
-                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
-                ('amount', models.DecimalField(verbose_name='amount', max_digits=20, decimal_places=4)),
-                ('currency', models.CharField(max_length=3, verbose_name='currency')),
-                ('status', models.CharField(default='new', max_length=20, verbose_name='status', db_index=True, choices=[('new', 'new'), ('in_progress', 'in progress'), ('partially_paid', 'partially paid'), ('paid', 'paid'), ('failed', 'failed')])),
-                ('backend', models.CharField(max_length=50, verbose_name='backend')),
-                ('created_on', models.DateTimeField(auto_now_add=True, verbose_name='created on', db_index=True)),
-                ('paid_on', models.DateTimeField(default=None, null=True, verbose_name='paid on', db_index=True, blank=True)),
-                ('amount_paid', models.DecimalField(default=0, verbose_name='amount paid', max_digits=20, decimal_places=4)),
-                ('external_id', models.CharField(max_length=64, null=True, verbose_name='external id', blank=True)),
-                ('description', models.CharField(max_length=128, null=True, verbose_name='Description', blank=True)),
-                ('order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='payment', to='funding.Funding')),
-            ],
-            options={
-                'ordering': ('-created_on',),
-                'verbose_name': 'Payment',
-                'verbose_name_plural': 'Payments',
-            },
-            bases=(models.Model, getpaid.abstract_mixin.AbstractMixin),
-        ),
-    ]
diff --git a/src/wolnelektury/migrations/getpaid/0002_auto_20151221_1225.py b/src/wolnelektury/migrations/getpaid/0002_auto_20151221_1225.py
deleted file mode 100644 (file)
index 3cc3f48..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
-# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
-#
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('getpaid', '0001_initial'),
-    ]
-
-    operations = [
-        migrations.AlterField(
-            model_name='payment',
-            name='description',
-            field=models.CharField(max_length=128, null=True, verbose_name='description', blank=True),
-        ),
-        migrations.AlterField(
-            model_name='payment',
-            name='status',
-            field=models.CharField(default='new', max_length=20, verbose_name='status', db_index=True, choices=[('new', 'new'), ('in_progress', 'in progress'), ('accepted_for_proc', 'accepted for processing'), ('partially_paid', 'partially paid'), ('paid', 'paid'), ('cancelled', 'cancelled'), ('failed', 'failed')]),
-        ),
-    ]
diff --git a/src/wolnelektury/migrations/getpaid/__init__.py b/src/wolnelektury/migrations/getpaid/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
index ac01166..124f476 100644 (file)
@@ -61,8 +61,6 @@ INSTALLED_APPS_CONTRIB = [
     'sorl.thumbnail',
     'honeypot',
     'fnpdjango',
-    'getpaid',
-    'getpaid.backends.payu',
     'django_extensions',
     'forms_builder.forms',
     'django_countries',
index b0c95c2..bf0cbcf 100644 (file)
@@ -8,14 +8,6 @@ THUMBNAIL_QUALITY = 95
 MODELTRANSLATION_DEFAULT_LANGUAGE = 'pl'
 MODELTRANSLATION_PREPOPULATE_LANGUAGE = 'pl'
 
-MIGRATION_MODULES = {
-    'getpaid': 'wolnelektury.migrations.getpaid',
-}
-
-GETPAID_BACKENDS = (
-    'getpaid.backends.payu',
-)
-
 PIWIK_URL = ''
 PIWIK_SITE_ID = 0
 PIWIK_TOKEN = ''