Extend the service URL field.
[django-cas-provider.git] / cas_provider / models.py
index 36014b5..14c2294 100644 (file)
@@ -35,8 +35,8 @@ class BaseTicket(models.Model):
 
 
 class ServiceTicket(BaseTicket):
 
 
 class ServiceTicket(BaseTicket):
-    user = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name=_('user'))
-    service = models.URLField(_('service'))
+    user = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name=_('user'), on_delete=models.CASCADE)
+    service = models.URLField(_('service'), max_length=2048)
 
     prefix = 'ST'
 
 
     prefix = 'ST'
 
@@ -64,9 +64,9 @@ class LoginTicket(BaseTicket):
 
 
 class ProxyGrantingTicket(BaseTicket):
 
 
 class ProxyGrantingTicket(BaseTicket):
-    user = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name=_('user'))
+    user = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name=_('user'), on_delete=models.CASCADE)
     service = models.URLField(_('service'), null=True)
     service = models.URLField(_('service'), null=True)
-    pgt = models.ForeignKey('self', null=True)
+    pgt = models.ForeignKey('self', null=True, on_delete=models.CASCADE)
     pgtiou = models.CharField(max_length=256, verbose_name=_('PGTiou'))
     prefix = 'PGT'
 
     pgtiou = models.CharField(max_length=256, verbose_name=_('PGTiou'))
     prefix = 'PGT'
 
@@ -81,7 +81,7 @@ class ProxyGrantingTicket(BaseTicket):
 
 
 class ProxyTicket(ServiceTicket):
 
 
 class ProxyTicket(ServiceTicket):
-    proxyGrantingTicket = models.ForeignKey(ProxyGrantingTicket, verbose_name=_('Proxy Granting Ticket'))
+    proxyGrantingTicket = models.ForeignKey(ProxyGrantingTicket, verbose_name=_('Proxy Granting Ticket'), on_delete=models.CASCADE)
 
     prefix = 'PT'
 
 
     prefix = 'PT'
 
@@ -91,7 +91,7 @@ class ProxyTicket(ServiceTicket):
 
 
 class ProxyGrantingTicketIOU(BaseTicket):
 
 
 class ProxyGrantingTicketIOU(BaseTicket):
-    proxyGrantingTicket = models.ForeignKey(ProxyGrantingTicket, verbose_name=_('Proxy Granting Ticket'))
+    proxyGrantingTicket = models.ForeignKey(ProxyGrantingTicket, verbose_name=_('Proxy Granting Ticket'), on_delete=models.CASCADE)
 
     prefix = 'PGTIOU'
 
 
     prefix = 'PGTIOU'