2016-07-03 18:11:48 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
|
|
# FOR A PARTICULAR PURPOSE. See the GNU General Public License version 3 for
|
|
|
|
# more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License version 3
|
|
|
|
# along with this program; if not, write to the Free Software Foundation, Inc., 51
|
|
|
|
# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
#
|
|
|
|
# (c) 2016 Valentin Samir
|
2016-06-29 00:28:59 +02:00
|
|
|
"""Clean old trickets management command"""
|
2015-06-12 18:10:52 +02:00
|
|
|
from django.core.management.base import BaseCommand
|
2015-05-28 17:30:27 +02:00
|
|
|
from django.utils.translation import ugettext_lazy as _
|
|
|
|
|
|
|
|
from ... import models
|
|
|
|
|
2015-06-12 18:10:52 +02:00
|
|
|
|
2015-05-28 17:30:27 +02:00
|
|
|
class Command(BaseCommand):
|
2016-06-29 00:28:59 +02:00
|
|
|
"""Clean old trickets"""
|
2015-05-28 17:30:27 +02:00
|
|
|
args = ''
|
2016-08-24 17:20:57 +02:00
|
|
|
help = _(u"Clean old tickets")
|
2015-05-28 17:30:27 +02:00
|
|
|
|
|
|
|
def handle(self, *args, **options):
|
2015-06-09 22:04:05 +02:00
|
|
|
models.User.clean_old_entries()
|
2015-05-28 17:30:27 +02:00
|
|
|
for ticket_class in [models.ServiceTicket, models.ProxyTicket, models.ProxyGrantingTicket]:
|
2015-06-09 22:04:05 +02:00
|
|
|
ticket_class.clean_old_entries()
|