mirror of
				https://github.com/ae-utbm/sith.git
				synced 2025-11-04 02:53:06 +00:00 
			
		
		
		
	Merge branch 'galaRequests' into 'master'
Some gala requests: new minor features See merge request ae/Sith!247
This commit is contained in:
		@@ -15,7 +15,7 @@
 | 
				
			|||||||
    <p>{% trans %}Your account doesn't have access to this page. To proceed,
 | 
					    <p>{% trans %}Your account doesn't have access to this page. To proceed,
 | 
				
			||||||
    please login with an account that has access.{% endtrans %}</p>
 | 
					    please login with an account that has access.{% endtrans %}</p>
 | 
				
			||||||
    {% else %}
 | 
					    {% else %}
 | 
				
			||||||
    <p>{% trans %}Please login to see this page.{% endtrans %}</p>
 | 
					    <p>{% trans %}Please login or create an account to see this page.{% endtrans %}</p>
 | 
				
			||||||
    {% endif %}
 | 
					    {% endif %}
 | 
				
			||||||
{% endif %}
 | 
					{% endif %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -30,5 +30,6 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
{# Assumes you setup the password_reset view in your URLconf #}
 | 
					{# Assumes you setup the password_reset view in your URLconf #}
 | 
				
			||||||
<p><a href="{{ url('core:password_reset') }}">{% trans %}Lost password?{% endtrans %}</a></p>
 | 
					<p><a href="{{ url('core:password_reset') }}">{% trans %}Lost password?{% endtrans %}</a></p>
 | 
				
			||||||
 | 
					<p><a href="{{ url('core:register') }}">{% trans %}Create account{% endtrans %}</a></p>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% endblock %}
 | 
					{% endblock %}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -490,7 +490,7 @@ class Selling(models.Model):
 | 
				
			|||||||
        event = self.product.eticket.event_title or _("Unknown event")
 | 
					        event = self.product.eticket.event_title or _("Unknown event")
 | 
				
			||||||
        subject = _("Eticket bought for the event %(event)s") % {"event": event}
 | 
					        subject = _("Eticket bought for the event %(event)s") % {"event": event}
 | 
				
			||||||
        message_html = _(
 | 
					        message_html = _(
 | 
				
			||||||
            "You bought an eticket for the event %(event)s.\nYou can download it on this page %(url)s."
 | 
					            "You bought an eticket for the event %(event)s.\nYou can download it directly from this link %(eticket)s.\nYou can also retrieve all your e-tickets on your account page %(url)s."
 | 
				
			||||||
        ) % {
 | 
					        ) % {
 | 
				
			||||||
            "event": event,
 | 
					            "event": event,
 | 
				
			||||||
            "url": "".join(
 | 
					            "url": "".join(
 | 
				
			||||||
@@ -502,10 +502,23 @@ class Selling(models.Model):
 | 
				
			|||||||
                    "</a>",
 | 
					                    "</a>",
 | 
				
			||||||
                )
 | 
					                )
 | 
				
			||||||
            ),
 | 
					            ),
 | 
				
			||||||
 | 
					            "eticket": "".join(
 | 
				
			||||||
 | 
					                (
 | 
				
			||||||
 | 
					                    '<a href="',
 | 
				
			||||||
 | 
					                    self.get_eticket_full_url(),
 | 
				
			||||||
 | 
					                    '">',
 | 
				
			||||||
 | 
					                    self.get_eticket_full_url(),
 | 
				
			||||||
 | 
					                    "</a>",
 | 
				
			||||||
 | 
					                )
 | 
				
			||||||
 | 
					            ),
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        message_txt = _(
 | 
					        message_txt = _(
 | 
				
			||||||
            "You bought an eticket for the event %(event)s.\nYou can download it on this page %(url)s."
 | 
					            "You bought an eticket for the event %(event)s.\nYou can download it directly from this link %(eticket)s.\nYou can also retrieve all your e-tickets on your account page %(url)s."
 | 
				
			||||||
        ) % {"event": event, "url": self.customer.get_full_url()}
 | 
					        ) % {
 | 
				
			||||||
 | 
					            "event": event,
 | 
				
			||||||
 | 
					            "url": self.customer.get_full_url(),
 | 
				
			||||||
 | 
					            "eticket": self.get_eticket_full_url(),
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        self.customer.user.email_user(subject, message_txt, html_message=message_html)
 | 
					        self.customer.user.email_user(subject, message_txt, html_message=message_html)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def save(self, allow_negative=False, *args, **kwargs):
 | 
					    def save(self, allow_negative=False, *args, **kwargs):
 | 
				
			||||||
@@ -568,11 +581,6 @@ class Selling(models.Model):
 | 
				
			|||||||
                    start=sub.subscription_start,
 | 
					                    start=sub.subscription_start,
 | 
				
			||||||
                )
 | 
					                )
 | 
				
			||||||
                sub.save()
 | 
					                sub.save()
 | 
				
			||||||
        try:
 | 
					 | 
				
			||||||
            if self.product.eticket:
 | 
					 | 
				
			||||||
                self.send_mail_customer()
 | 
					 | 
				
			||||||
        except:
 | 
					 | 
				
			||||||
            pass
 | 
					 | 
				
			||||||
        if self.customer.user.preferences.notify_on_click:
 | 
					        if self.customer.user.preferences.notify_on_click:
 | 
				
			||||||
            Notification(
 | 
					            Notification(
 | 
				
			||||||
                user=self.customer.user,
 | 
					                user=self.customer.user,
 | 
				
			||||||
@@ -588,6 +596,16 @@ class Selling(models.Model):
 | 
				
			|||||||
                type="SELLING",
 | 
					                type="SELLING",
 | 
				
			||||||
            ).save()
 | 
					            ).save()
 | 
				
			||||||
        super(Selling, self).save(*args, **kwargs)
 | 
					        super(Selling, self).save(*args, **kwargs)
 | 
				
			||||||
 | 
					        try:
 | 
				
			||||||
 | 
					            # The product has no id until it's saved
 | 
				
			||||||
 | 
					            if self.product.eticket:
 | 
				
			||||||
 | 
					                self.send_mail_customer()
 | 
				
			||||||
 | 
					        except:
 | 
				
			||||||
 | 
					            pass
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def get_eticket_full_url(self):
 | 
				
			||||||
 | 
					        eticket_url = reverse("counter:eticket_pdf", kwargs={"selling_id": self.id})
 | 
				
			||||||
 | 
					        return "".join(["https://", settings.SITH_URL, eticket_url])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class Permanency(models.Model):
 | 
					class Permanency(models.Model):
 | 
				
			||||||
 
 | 
				
			|||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
		Reference in New Issue
	
	Block a user