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
4e566f82
Commit
4e566f82
authored
Jan 23, 2025
by
Yvon Kerdoncuff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unused method home in shifts/views.py
parent
629f108f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
56 deletions
+0
-56
urls.py
shifts/urls.py
+0
-1
views.py
shifts/views.py
+0
-55
No files found.
shifts/urls.py
View file @
4e566f82
...
...
@@ -6,7 +6,6 @@ from . import views
urlpatterns
=
[
url
(
r'^index/(?P<partner_id>\d+)/(?P<hashed_date>[a-z0-9]+)$'
,
views
.
home
),
url
(
r'^get_list_shift_calendar/(?P<partner_id>\d+)/?$'
,
views
.
get_list_shift_calendar
),
url
(
r'^get_list_shift_partner/(?P<partner_id>\d+)/?$'
,
views
.
get_list_shift_partner
),
...
...
shifts/views.py
View file @
4e566f82
...
...
@@ -11,61 +11,6 @@ state_shift_allowed = ["up_to_date", "alert", "delay"]
tz
=
pytz
.
timezone
(
"Europe/Paris"
)
def
home
(
request
,
partner_id
,
hashed_date
):
import
hashlib
cs
=
CagetteShift
()
partnerData
=
cs
.
get_data_partner
(
partner_id
)
md5_calc
=
hashlib
.
md5
(
partnerData
[
'create_date'
]
.
encode
(
'utf-8'
))
.
hexdigest
()
if
(
md5_calc
==
hashed_date
):
# if not request.session.get('odoo_token', False):
# import uuid
# request.session['odoo_token'] = uuid.uuid4().hex
# request.session.modified = True
# Ne fonctionne pas !!! Les données de sessions sont perdues à la connexion suivante (ajax : voir cross domain cookies
if
len
(
partnerData
)
>
0
:
partnerData
[
'verif_token'
]
=
md5_calc
if
len
(
partnerData
[
'leave_ids'
])
>
0
:
listLeave
=
cs
.
get_leave
(
int
(
partner_id
))
if
len
(
listLeave
)
>
0
:
partnerData
[
"is_leave"
]
=
True
partnerData
[
"leave_start_date"
]
=
listLeave
[
0
][
"start_date"
]
partnerData
[
"leave_stop_date"
]
=
listLeave
[
0
][
"stop_date"
]
if
partnerData
[
'cooperative_state'
]
in
state_shift_allowed
:
# domain = "127.0.0.1"
domain
=
getattr
(
settings
,
'EMAIL_DOMAIN'
,
'lacagette-coop.fr'
)
days_to_hide
=
"0"
if
hasattr
(
settings
,
'SHIFT_EXCHANGE_DAYS_TO_HIDE'
):
days_to_hide
=
settings
.
SHIFT_EXCHANGE_DAYS_TO_HIDE
context
=
{
'title'
:
'Calendrier'
,
"partnerData"
:
partnerData
,
'daysToHide'
:
days_to_hide
,
'SHIFT_INFO'
:
settings
.
SHIFT_INFO
,
'PB_INSTRUCTIONS'
:
settings
.
PB_INSTRUCTIONS
,
'domain'
:
domain
}
context
[
'ADDITIONAL_INFO_SHIFT_PAGE'
]
=
getattr
(
settings
,
'ADDITIONAL_INFO_SHIFT_PAGE'
,
''
)
if
hasattr
(
settings
,
'CALENDAR_NO_MORE_LINK'
):
if
settings
.
CALENDAR_NO_MORE_LINK
is
True
:
context
[
'calendarEventNoMoreLinks'
]
=
True
if
hasattr
(
settings
,
'CAL_INITIAL_VIEW'
):
context
[
'calInitialView'
]
=
settings
.
CAL_INITIAL_VIEW
# No effect with 3.9 version : TODO upgrade fullCalendar lib
# Needs init calendar rewriting
response
=
render
(
request
,
'shifts/shift_exchange.html'
,
context
)
else
:
context
=
{
'title'
:
'Invitation'
,
"partnerData"
:
partnerData
}
if
hasattr
(
settings
,
'UNSUBSCRIBED_MSG'
):
context
[
'UNSUBSCRIBED_MSG'
]
=
settings
.
UNSUBSCRIBED_MSG
response
=
render
(
request
,
'shifts/shift_states_not_allowed.html'
,
context
)
# response.set_cookie('odoo_token', request.session.get('odoo_token', False) )
return
response
else
:
return
HttpResponseNotFound
(
'<h1>Nothing to show !</h1>'
)
else
:
return
HttpResponseForbidden
()
def
_is_middled_filled_considered
(
reserved
,
max
):
"""Added to fit with new LaCagette need. (based on num rather than
%
)."""
...
...
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