Compare commits

...

5 Commits

Author SHA1 Message Date
Raphael Michel
4fe9eeaaee Bump version 2017-05-18 09:52:37 +02:00
Raphael Michel
77ed3193b9 Add release config for GitLab CI 2017-05-18 09:51:50 +02:00
Raphael Michel
c82b37739e Fix critical bug in item creation 2017-05-18 09:51:39 +02:00
Raphael Michel
dba820028f Link PayPal and Stripe documentation in the respective forms 2017-05-18 09:51:39 +02:00
Raphael Michel
90c5fcd050 Ticket PDFs: Do not hide attendee name if code is hidden 2017-05-18 09:51:39 +02:00
7 changed files with 51 additions and 19 deletions

View File

@@ -2,11 +2,32 @@ before_script:
tests:
stage: test
script:
- virtualenv-3.4 env
- virtualenv env
- source env/bin/activate
- pip install -U pip wheel setuptools
- XDG_CACHE_HOME=/cache bash .travis.sh style
- XDG_CACHE_HOME=/cache bash .travis.sh tests
- XDG_CACHE_HOME=/cache bash .travis.sh doctests
tags:
- python3
pypi:
stage: release
script:
- cp /keys/.pypirc ~/.pypirc
- virtualenv env
- source env/bin/activate
- pip install -U pip wheel setuptools
- XDG_CACHE_HOME=/cache pip3 install -Ur src/requirements.txt -r src/requirements/dev.txt -r src/requirements/py34.txt
- cd src
- python setup.py sdist upload
- python setup.py bdist_wheel upload
tags:
- python3
only:
- release
artifacts:
paths:
- src/dist/
stages:
- test
- build
- release

View File

@@ -1 +1 @@
__version__ = "1.3.0"
__version__ = "1.3.1"

View File

@@ -2,6 +2,7 @@ import copy
from django import forms
from django.core.exceptions import ValidationError
from django.db.models import Max
from django.forms import BooleanField, ModelMultipleChoiceField
from django.forms.formsets import DELETION_FIELD_NAME
from django.utils.translation import ugettext as __, ugettext_lazy as _
@@ -120,7 +121,20 @@ class ItemCreateForm(I18nModelForm):
)
def save(self, *args, **kwargs):
if self.cleaned_data.get('copy_from'):
self.instance.description = self.cleaned_data['copy_from'].description
self.instance.active = self.cleaned_data['copy_from'].active
self.instance.available_from = self.cleaned_data['copy_from'].available_from
self.instance.available_until = self.cleaned_data['copy_from'].available_until
self.instance.require_voucher = self.cleaned_data['copy_from'].require_voucher
self.instance.hide_without_voucher = self.cleaned_data['copy_from'].hide_without_voucher
self.instance.allow_cancel = self.cleaned_data['copy_from'].allow_cancel
self.instance.min_per_order = self.cleaned_data['copy_from'].min_per_order
self.instance.max_per_order = self.cleaned_data['copy_from'].max_per_order
self.instance.position = (self.event.items.aggregate(p=Max('position'))['p'] or 0) + 1
instance = super().save(*args, **kwargs)
if self.cleaned_data.get('has_variations'):
if self.cleaned_data.get('copy_from') and self.cleaned_data.get('copy_from').has_variations:
for variation in self.cleaned_data['copy_from'].variations.all():
@@ -131,8 +145,9 @@ class ItemCreateForm(I18nModelForm):
item=instance, value=__('Standard')
)
for question in Question.objects.filter(items=self.cleaned_data.get('copy_from')):
question.items.add(instance)
if self.cleaned_data.get('copy_from'):
for question in self.cleaned_data['copy_from'].questions.all():
question.items.add(instance)
return instance

View File

@@ -4,7 +4,7 @@ from django.contrib import messages
from django.core.files import File
from django.core.urlresolvers import resolve, reverse
from django.db import transaction
from django.db.models import Count, F, Max, Q
from django.db.models import Count, F, Q
from django.forms.models import ModelMultipleChoiceField, inlineformset_factory
from django.http import Http404, HttpResponseRedirect
from django.shortcuts import redirect
@@ -792,18 +792,6 @@ class ItemCreate(EventPermissionRequiredMixin, CreateView):
@transaction.atomic
def form_valid(self, form):
messages.success(self.request, _('Your changes have been saved.'))
if form.cleaned_data['copy_from']:
form.instance.description = form.cleaned_data['copy_from'].description
form.instance.active = form.cleaned_data['copy_from'].active
form.instance.available_from = form.cleaned_data['copy_from'].available_from
form.instance.available_until = form.cleaned_data['copy_from'].available_until
form.instance.require_voucher = form.cleaned_data['copy_from'].require_voucher
form.instance.hide_without_voucher = form.cleaned_data['copy_from'].hide_without_voucher
form.instance.allow_cancel = form.cleaned_data['copy_from'].allow_cancel
form.instance.min_per_order = form.cleaned_data['copy_from'].min_per_order
form.instance.max_per_order = form.cleaned_data['copy_from'].max_per_order
form.instance.position = (self.request.event.items.aggregate(p=Max('position'))['p'] or 0) + 1
ret = super().form_valid(form)
form.instance.log_action('pretix.event.item.added', user=self.request.user, data={

View File

@@ -39,6 +39,10 @@ class Paypal(BasePaymentProvider):
('client_id',
forms.CharField(
label=_('Client ID'),
help_text=_('<a target="_blank" href="{docs_url}">{text}</a>').format(
text=_('Click here for a tutorial on how to obtain the required keys'),
docs_url='https://docs.pretix.eu/en/latest/user/payments/paypal.html'
)
)),
('secret',
forms.CharField(

View File

@@ -28,6 +28,10 @@ class Stripe(BasePaymentProvider):
('secret_key',
forms.CharField(
label=_('Secret key'),
help_text=_('<a target="_blank" href="{docs_url}">{text}</a>').format(
text=_('Click here for a tutorial on how to obtain the required keys'),
docs_url='https://docs.pretix.eu/en/latest/user/payments/stripe.html'
)
)),
('publishable_key',
forms.CharField(

View File

@@ -79,7 +79,7 @@ class PdfTicketOutput(BaseTicketOutput):
p.drawString(code_x * units.mm, code_y * units.mm, op.secret)
attendee_s = self.settings.get('attendee_s', default=0, as_type=float)
if code_s and op.attendee_name:
if attendee_s and op.attendee_name:
p.setFont("Helvetica", attendee_s)
attendee_x = self.settings.get('attendee_x', default=15, as_type=float)
attendee_y = self.settings.get('attendee_y', default=90, as_type=float)