Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
third-party
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cooperatic-foodcoops
third-party
Commits
c753cf5b
Commit
c753cf5b
authored
Jan 23, 2025
by
Yvon Kerdoncuff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unused code + always display suspended as Rattrapage
parent
aca89b48
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
19 deletions
+3
-19
models.py
members/models.py
+3
-5
views.py
shifts/views.py
+0
-3
views.py
shop/views.py
+0
-1
views.py
website/views.py
+0
-10
No files found.
members/models.py
View file @
c753cf5b
...
@@ -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
...
...
shifts/views.py
View file @
c753cf5b
...
@@ -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"
)
...
...
shop/views.py
View file @
c753cf5b
...
@@ -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
...
...
website/views.py
View file @
c753cf5b
# -*- 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
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment