mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-09 19:40:19 +00:00
Add picture-people relation and ask for removal thing
This commit is contained in:
19
core/migrations/0008_sithfile_asked_for_removal.py
Normal file
19
core/migrations/0008_sithfile_asked_for_removal.py
Normal file
@ -0,0 +1,19 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('core', '0007_auto_20161108_1703'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='sithfile',
|
||||
name='asked_for_removal',
|
||||
field=models.BooleanField(default=False, verbose_name='asked for removal'),
|
||||
),
|
||||
]
|
@ -503,6 +503,7 @@ class SithFile(models.Model):
|
||||
size = models.IntegerField(_("size"), default=0)
|
||||
date = models.DateTimeField(_('date'), auto_now=True)
|
||||
is_moderated = models.BooleanField(_("is moderated"), default=False)
|
||||
asked_for_removal = models.BooleanField(_("asked for removal"), default=False)
|
||||
|
||||
class Meta:
|
||||
verbose_name = _("file")
|
||||
|
@ -58,6 +58,8 @@ class CanEditPropMixin(View):
|
||||
"""
|
||||
def dispatch(self, request, *arg, **kwargs):
|
||||
res = super(CanEditPropMixin, self).dispatch(request, *arg, **kwargs)
|
||||
if res.__class__.status_code == 302:
|
||||
return res
|
||||
if hasattr(self, 'object'):
|
||||
obj = self.object
|
||||
elif hasattr(self, 'object_list'):
|
||||
@ -76,6 +78,8 @@ class CanEditMixin(View):
|
||||
"""
|
||||
def dispatch(self, request, *arg, **kwargs):
|
||||
res = super(CanEditMixin, self).dispatch(request, *arg, **kwargs)
|
||||
if res.__class__.status_code == 302:
|
||||
return res
|
||||
if hasattr(self, 'object'):
|
||||
obj = self.object
|
||||
elif hasattr(self, 'object_list'):
|
||||
@ -94,6 +98,8 @@ class CanViewMixin(View):
|
||||
"""
|
||||
def dispatch(self, request, *arg, **kwargs):
|
||||
res = super(CanViewMixin, self).dispatch(request, *arg, **kwargs)
|
||||
if res.__class__.status_code == 302:
|
||||
return res
|
||||
if hasattr(self, 'object'):
|
||||
obj = self.object
|
||||
elif hasattr(self, 'object_list'):
|
||||
|
Reference in New Issue
Block a user