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
aca89b48
Commit
aca89b48
authored
Jan 23, 2025
by
Yvon Kerdoncuff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove probably method index in website/views.py
parent
4e566f82
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
83 deletions
+0
-83
views.py
website/views.py
+0
-83
No files found.
website/views.py
View file @
aca89b48
...
...
@@ -23,89 +23,6 @@ def _get_response_according_credentials(request, credentials, context, template)
response
.
set_cookie
(
'deconnect_option'
,
'true'
)
return
response
def
index
(
request
):
"""Render main."""
template
=
loader
.
get_template
(
'shifts/shift_exchange.html'
)
# print (make_password(request.POST.get('password')))
# print (check_password('06101998', 'argon2$argon2i$v=19$m=512,t=2,p=2$bTBrSHFoS0JjSGUw$DvhMOtwbYW/qlhkYjW1k0g'))
credentials
=
CagetteMember
.
get_credentials
(
request
)
context
=
{
'title'
:
'Espace Coopérateurs'
,
'SHIFT_INFO'
:
settings
.
SHIFT_INFO
,
'PB_INSTRUCTIONS'
:
settings
.
PB_INSTRUCTIONS
,
}
context
[
'with_website_menu'
]
=
getattr
(
settings
,
'WITH_WEBSITE_MENU'
,
None
)
if
(
'failure'
in
credentials
):
template
=
loader
.
get_template
(
'website/connect.html'
)
context
[
'msg'
]
=
''
if
'msg'
in
credentials
:
context
[
'msg'
]
=
credentials
[
'msg'
]
context
[
'password_placeholder'
]
=
'Naissance (jjmmaaaa)'
elif
(
'validation_state'
in
credentials
)
and
credentials
[
'validation_state'
]
==
'waiting_validation_member'
:
template
=
loader
.
get_template
(
'members/validation_coop.html'
)
referer
=
request
.
META
.
get
(
'HTTP_REFERER'
)
doc
=
CagetteMember
.
get_couchdb_data
(
credentials
[
'login'
])
if
len
(
doc
)
>
1
:
context
=
{
'title'
:
'Validation inscription'
,
'coop'
:
json
.
dumps
(
doc
),
'coop_msg'
:
doc
.
get
(
'coop_msg'
),
'warning_placeholder'
:
"""Signaler ici une anomalie du formulaire,
un problème lié à votre souscription"""
,
'referer'
:
referer
,
'mag_place_string'
:
settings
.
MAG_NAME
,
'office_place_string'
:
settings
.
OFFICE_NAME
,
'max_begin_hour'
:
settings
.
MAX_BEGIN_HOUR
,
'payment_meanings'
:
settings
.
SUBSCRIPTION_PAYMENT_MEANINGS
,
'em_url'
:
settings
.
EM_URL
,
'WELCOME_ENTRANCE_MSG'
:
settings
.
WELCOME_ENTRANCE_MSG
,
'WELCOME_SUBTITLE_ENTRANCE_MSG'
:
getattr
(
settings
,
'WELCOME_SUBTITLE_ENTRANCE_MSG'
,
''
)}
if
hasattr
(
settings
,
'SUBSCRIPTION_ASK_FOR_SEX'
):
context
[
'ask_for_sex'
]
=
settings
.
SUBSCRIPTION_ASK_FOR_SEX
if
hasattr
(
settings
,
'SUBSCRIPTION_ASK_FOR_JOB'
):
context
[
'ask_for_job'
]
=
settings
.
SUBSCRIPTION_ASK_FOR_JOB
if
hasattr
(
settings
,
'SUBSCRIPTION_ADD_STREET2'
):
context
[
'ask_for_street2'
]
=
settings
.
SUBSCRIPTION_ADD_STREET2
if
hasattr
(
settings
,
'SUBSCRIPTION_ADD_SECOND_PHONE'
):
context
[
'ask_for_second_phone'
]
=
settings
.
SUBSCRIPTION_ADD_SECOND_PHONE
else
:
import
hashlib
cs
=
CagetteShift
()
if
'id'
in
request
.
COOKIES
:
partner_id
=
request
.
COOKIES
[
'id'
]
else
:
partner_id
=
credentials
[
'id'
]
partnerData
=
cs
.
get_data_partner
(
partner_id
)
if
'create_date'
in
partnerData
:
md5_calc
=
hashlib
.
md5
(
partnerData
[
'create_date'
]
.
encode
(
'utf-8'
))
.
hexdigest
()
partnerData
[
'verif_token'
]
=
md5_calc
# coop_logger.info(partnerData)
# Following part is a copy of shifts/views.py (def home)
context
[
'partnerData'
]
=
partnerData
days_to_hide
=
"0"
context
[
'ADDITIONAL_INFO_SHIFT_PAGE'
]
=
getattr
(
settings
,
'ADDITIONAL_INFO_SHIFT_PAGE'
,
''
)
if
hasattr
(
settings
,
'SHIFT_EXCHANGE_DAYS_TO_HIDE'
):
days_to_hide
=
settings
.
SHIFT_EXCHANGE_DAYS_TO_HIDE
context
[
'daysToHide'
]
=
days_to_hide
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
if
not
(
partnerData
[
'cooperative_state'
]
in
state_shift_allowed
):
if
hasattr
(
settings
,
'UNSUBSCRIBED_MSG'
):
context
[
'UNSUBSCRIBED_MSG'
]
=
settings
.
UNSUBSCRIBED_MSG
template
=
loader
.
get_template
(
'shifts/shift_states_not_allowed.html'
)
else
:
# may arrive when switching database without cleaning cookie
return
redirect
(
'/website/deconnect'
)
return
_get_response_according_credentials
(
request
,
credentials
,
context
,
template
)
def
info_perso
(
request
):
from
outils.functions
import
extract_firstname_lastname
# coop_logger.info('On cherche à accéder à la page info perso')
...
...
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