Commit c753cf5b by Yvon Kerdoncuff

remove unused code + always display suspended as Rattrapage

parent aca89b48
...@@ -808,17 +808,13 @@ class CagetteMember(models.Model): ...@@ -808,17 +808,13 @@ class CagetteMember(models.Model):
@staticmethod @staticmethod
def get_state_fr(coop_state): def get_state_fr(coop_state):
"""Return french version of given coop_state.""" """Return french version of given coop_state."""
company = getattr(settings, 'COMPANY_CODE', '')
if coop_state == 'alert': if coop_state == 'alert':
fr_state = 'En alerte' fr_state = 'En alerte'
elif coop_state == 'delay': elif coop_state == 'delay':
fr_state = 'Délai accordé' fr_state = 'Délai accordé'
elif coop_state == 'suspended': elif coop_state == 'suspended':
if company == 'lacagette':
fr_state = 'Rattrapage' fr_state = 'Rattrapage'
else:
fr_state = 'Suspendu(e)'
elif coop_state == 'not_concerned': elif coop_state == 'not_concerned':
fr_state = 'Non concerné(e)' fr_state = 'Non concerné(e)'
elif coop_state == 'blocked': elif coop_state == 'blocked':
...@@ -835,6 +831,8 @@ class CagetteMember(models.Model): ...@@ -835,6 +831,8 @@ class CagetteMember(models.Model):
fr_state = 'En binôme' fr_state = 'En binôme'
elif coop_state == 'gone': elif coop_state == 'gone':
fr_state = 'Parti(e)' fr_state = 'Parti(e)'
elif coop_state == 'vacation':
fr_state = 'En vacances'
else: else:
fr_state = 'Inconnu' fr_state = 'Inconnu'
return fr_state return fr_state
......
...@@ -6,9 +6,6 @@ from shifts.models import CagetteShift ...@@ -6,9 +6,6 @@ from shifts.models import CagetteShift
from members.models import CagetteMember from members.models import CagetteMember
import shifts.fonctions import shifts.fonctions
# working_state = ['up_to_date', 'alert', 'exempted', 'delay', 'suspended']
state_shift_allowed = ["up_to_date", "alert", "delay"]
tz = pytz.timezone("Europe/Paris") tz = pytz.timezone("Europe/Paris")
......
...@@ -65,7 +65,6 @@ def index(request, mode="shop"): ...@@ -65,7 +65,6 @@ def index(request, mode="shop"):
credentials = CagetteMember.get_credentials(request) credentials = CagetteMember.get_credentials(request)
shop_settings = CagetteShop.get_shop_settings() shop_settings = CagetteShop.get_shop_settings()
allowed_states = ["up_to_date", "alert", "delay"]
# Uncomment if 'coop_state' in credentials .... etc # Uncomment if 'coop_state' in credentials .... etc
# to prevent other states people to use the shop # to prevent other states people to use the shop
allowed = True allowed = True
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
"""Public access (need identification for data access).""" """Public access (need identification for data access)."""
from outils.common_imports import *
from outils.for_view_imports import *
from outils.images_imports import * from outils.images_imports import *
from members.models import CagetteMember from members.models import CagetteMember
from shifts.models import CagetteShift
from django.contrib.auth.hashers import check_password, make_password
state_shift_allowed = ["up_to_date", "alert", "delay"]
def _get_response_according_credentials(request, credentials, context, template): def _get_response_according_credentials(request, credentials, context, template):
response = HttpResponse(template.render(context, request)) response = HttpResponse(template.render(context, request))
...@@ -90,7 +81,6 @@ def info_perso(request): ...@@ -90,7 +81,6 @@ def info_perso(request):
context['data'] = template_data context['data'] = template_data
else: # no member found corresponding to partner_id else: # no member found corresponding to partner_id
return redirect('/website/deconnect') return redirect('/website/deconnect')
# print(str(context['data']))
return _get_response_according_credentials(request, credentials, context, template) return _get_response_according_credentials(request, credentials, context, template)
def update_info_perso(request): def update_info_perso(request):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment