Skip to content

Commit

Permalink
Bumped CB version and pinned to 1.3.6.
Browse files Browse the repository at this point in the history
  • Loading branch information
ajrbyers committed Aug 23, 2019
1 parent 20df2e4 commit ac65426
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 12 deletions.
22 changes: 22 additions & 0 deletions migrations/0037_auto_20190823_1144.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.23 on 2019-08-23 10:44
from __future__ import unicode_literals

import django.core.files.storage
from django.db import migrations, models
import plugins.consortial_billing.models


class Migration(migrations.Migration):

dependencies = [
('consortial_billing', '0036_banding_size'),
]

operations = [
migrations.AlterField(
model_name='poll',
name='file',
field=models.FileField(blank=True, null=True, storage=django.core.files.storage.FileSystemStorage(location='/Users/ajrbyers/janeway/src/media'), upload_to=plugins.consortial_billing.models.file_upload_path),
),
]
47 changes: 47 additions & 0 deletions migrations/0038_auto_20190823_1144.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.23 on 2019-08-23 10:44
from __future__ import unicode_literals

from django.db import migrations

from plugins.consortial_billing import plugin_settings


def upgrade_plugin_version(apps, schema_editor):
Plugin = apps.get_model('utils', 'Plugin')

try:
_plugin = Plugin.objects.get(
name=plugin_settings.SHORT_NAME,
)
_plugin.version = '1.1'
_plugin.save()
except BaseException:
pass


def downgrade_plugin_version(apps, schema_editor):
Plugin = apps.get_model('utils', 'Plugin')

try:
_plugin = Plugin.objects.get(
name=plugin_settings.SHORT_NAME,
)
_plugin.version = '1.0'
_plugin.save()
except Plugin.object.DoesNotExist:
pass


class Migration(migrations.Migration):

dependencies = [
('consortial_billing', '0037_auto_20190823_1144'),
]

operations = [
migrations.RunPython(
upgrade_plugin_version,
reverse_code=downgrade_plugin_version,
)
]
27 changes: 16 additions & 11 deletions plugin_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@
PLUGIN_NAME = 'Consortial Billing'
DESCRIPTION = 'This is a plugin to handle consortial billing.'
AUTHOR = 'Martin Paul Eve'
VERSION = '1.0'
VERSION = '1.1'
SHORT_NAME = 'consortial_billing'
DISPLAY_NAME = 'supporters'
MANAGER_URL = 'consortial_index'
JANEWAY_VERSION = "1.3.6"


def get_self():
new_plugin, created = models.Plugin.objects.get_or_create(name=SHORT_NAME,
display_name=DISPLAY_NAME,
version=VERSION,
enabled=True,
press_wide=True)
new_plugin, created = models.Plugin.objects.get_or_create(
name=SHORT_NAME,
display_name=DISPLAY_NAME,
enabled=True,
press_wide=True,
defaults={'version': VERSION},
)
return new_plugin


Expand Down Expand Up @@ -101,11 +104,13 @@ def currency_options():


def install():
new_plugin, created = models.Plugin.objects.get_or_create(name=SHORT_NAME,
display_name=DISPLAY_NAME,
version=VERSION,
enabled=True,
press_wide=True)
new_plugin, created = models.Plugin.objects.get_or_create(
name=SHORT_NAME,
display_name=DISPLAY_NAME,
enabled=True,
press_wide=True,
defaults={'version': VERSION},
)

if created:
print('Plugin {0} installed.'.format(PLUGIN_NAME))
Expand Down
2 changes: 1 addition & 1 deletion templates/consortial_billing/supporters_press.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "press/core/base.html" %}
{% extends "core/base.html" %}

{% block title %}Supporters{% endblock title %}

Expand Down

0 comments on commit ac65426

Please sign in to comment.