Fix deprecations in project
This commit is contained in:
@@ -321,7 +321,7 @@ class ExternalImageInfoItem(InfoItem):
|
|||||||
class InfoInstance(models.Model):
|
class InfoInstance(models.Model):
|
||||||
"""Class for Info instance in Infoscreen."""
|
"""Class for Info instance in Infoscreen."""
|
||||||
|
|
||||||
rotation = models.ForeignKey('Rotation', related_name='instances')
|
rotation = models.ForeignKey('Rotation', related_name='instances', on_delete=models.CASCADE)
|
||||||
duration = models.FloatField(default=15.0) # seconds
|
duration = models.FloatField(default=15.0) # seconds
|
||||||
# generic relation to some kind of InfoItem
|
# generic relation to some kind of InfoItem
|
||||||
item_id = models.PositiveIntegerField()
|
item_id = models.PositiveIntegerField()
|
||||||
|
|||||||
+1
-1
@@ -56,7 +56,7 @@ class Comment(CommentParent):
|
|||||||
verbose_name_plural = _('Kaehmykommentit')
|
verbose_name_plural = _('Kaehmykommentit')
|
||||||
|
|
||||||
message = models.TextField(_('Message'))
|
message = models.TextField(_('Message'))
|
||||||
parent = models.ForeignKey('CommentParent', related_name='messages')
|
parent = models.ForeignKey('CommentParent', related_name='messages', on_delete=models.CASCADE)
|
||||||
|
|
||||||
|
|
||||||
class Application(CommentParent):
|
class Application(CommentParent):
|
||||||
|
|||||||
+1
-1
@@ -138,7 +138,7 @@ class Role(PresetRole):
|
|||||||
|
|
||||||
start_date = models.DateField(_('Start date'))
|
start_date = models.DateField(_('Start date'))
|
||||||
end_date = models.DateField(_('End date'))
|
end_date = models.DateField(_('End date'))
|
||||||
official = models.ForeignKey('Official', related_name='roles')
|
official = models.ForeignKey('Official', related_name='roles', on_delete=models.CASCADE)
|
||||||
|
|
||||||
|
|
||||||
class Official(User):
|
class Official(User):
|
||||||
|
|||||||
+1
-1
@@ -40,7 +40,7 @@ def login_view(request, *args, **kwargs):
|
|||||||
|
|
||||||
# user got here by a get request
|
# user got here by a get request
|
||||||
user = request.user
|
user = request.user
|
||||||
if user.is_authenticated():
|
if user.is_authenticated:
|
||||||
# user shoud not be here authenticated with get but get rid if is
|
# user shoud not be here authenticated with get but get rid if is
|
||||||
return redirect("/")
|
return redirect("/")
|
||||||
return render(request, "login.html", {})
|
return render(request, "login.html", {})
|
||||||
|
|||||||
Reference in New Issue
Block a user