Skip to content

Commit

Permalink
#182 cont...
Browse files Browse the repository at this point in the history
  • Loading branch information
amschaal committed Apr 22, 2022
1 parent 39e06ee commit 581e969
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions ezreg/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Organizer(models.Model):
name = models.CharField(max_length=50)
description = models.TextField()
config = postgres_fields.JSONField(default=dict)
def __unicode__(self):
def __str__(self):
return self.name

class OrganizerUserPermission(models.Model):
Expand All @@ -42,7 +42,7 @@ class OrganizerUserPermission(models.Model):
permission = models.CharField(max_length=25,choices=PERMISSION_CHOICES)
class Meta:
unique_together = (('organizer','user','permission'))
def __unicode__(self):
def __str__(self):
return '%s - %s: %s'%(self.organizer,self.permission,self.user)

class Event(models.Model):
Expand Down Expand Up @@ -185,7 +185,7 @@ def credit_card_charges_text(self):
@property
def total_charges(self):
return round(self.service_charges + self.credit_card_charges, 2)
def __unicode__(self):
def __str__(self):
return self.title
class Meta:
permissions = (
Expand Down Expand Up @@ -229,7 +229,7 @@ class Price(models.Model):
end_date = models.DateField(null=True,blank=True)
quantity = models.PositiveIntegerField(null=True)
disable = models.BooleanField(default=False)
def __unicode__(self):
def __str__(self):
return mark_safe('<span title="%s"><b>$%s</b> - %s</span>' % (self.description,str(self.amount),self.name))
class Meta:
ordering = ('order',)
Expand Down Expand Up @@ -415,7 +415,7 @@ def get_user_queryset(user):
return PaymentProcessor.objects.all()
OUPs = OrganizerUserPermission.objects.filter(user=user,permission=OrganizerUserPermission.PERMISSION_MANAGE_PROCESSORS)
return PaymentProcessor.objects.filter(organizer__in=[oup.organizer_id for oup in OUPs])
def __unicode__(self):
def __str__(self):
return self.name

class EventProcessor(models.Model):
Expand Down
2 changes: 1 addition & 1 deletion ezreg/payment/touchnet/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def get_post_form(payment):
'CANCEL_LINK': settings.SITE_URL + reverse('event',kwargs={'slug_or_id':payment.registration.event.slug_or_id}),
'AMT': payment.amount
}
m.update(posting_key+data['EXT_TRANS_ID']+str(data['AMT']))
m.update((posting_key+data['EXT_TRANS_ID']+str(data['AMT'])).encode('utf-8'))
data['VALIDATION_KEY']=base64.encodestring(m.digest())
form = TouchnetPostForm(initial=data)
form.action = settings.TOUCHNET_TEST_URL if payment.registration.test else settings.TOUCHNET_PRODUCTION_URL
Expand Down
2 changes: 1 addition & 1 deletion ezreg/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class RegistrationWizard(SessionWizardView):
condition_dict={'payment_form': show_payment_form_condition,'price_form':show_price_form_condition,'registration_form_custom':registration_form_custom_condition}

def done(self, form_list, **kwargs):
registration = RegistrationForm(form_list[0].cleaned_data,event=self.event,instance=self.registration).save(commit=False)
registration = RegistrationForm(list(form_list)[0].cleaned_data,event=self.event,instance=self.registration).save(commit=False)
custom_data = self.get_cleaned_data_for_step('registration_form_custom') or None
if custom_data:
registration.data = custom_data
Expand Down
2 changes: 1 addition & 1 deletion ezreg/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ def format_registration_data(event,registrations,encode_utf8=True):
data.update({'payment.amount':r.price.amount})
if encode_utf8:
for key, val in data.items():
data[key] = unicode(form_value(val)).encode("utf-8") if val is not None else None
data[key] = str(form_value(val)) if val is not None else None
reg_data['data'].append(data)
return reg_data

0 comments on commit 581e969

Please sign in to comment.