Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Birin Sanchez
Keel - LDH Middleware
Commits
2f9525dd
Commit
2f9525dd
authored
Jul 03, 2019
by
Noe Nieto
💬
Browse files
Simplify default lastname feature
parent
ae36993d
Changes
3
Hide whitespace changes
Inline
Side-by-side
config_sample/ldh_middleware/config.ini
View file @
2f9525dd
...
...
@@ -76,6 +76,3 @@ DEFAULT_FROM_EMAIL = "Do not reply <noreply@example.com>"
# This is the link to the subscribe page, used in different parts of the middleware
SUBSCRIBE_HREF
=
/#bundle
# This is the default last name for users created here
DEFAUL_USER_LASTNAME
=
@example.com
middleware/settings.py
View file @
2f9525dd
import
ldap
import
strictyaml
from
decouple
import
Config
,
Csv
,
RepositoryIni
...
...
@@ -294,6 +295,3 @@ EMAIL_USE_SSL = config('EMAIL_USE_SSL', False, cast=bool)
# This is the link to the subscribe page, used in different parts of the middleware
SUBSCRIBE_HREF
=
config
(
'SUBSCRIBE_HREF'
)
# User Account last name
DEFAUL_USER_LASTNAME
=
config
(
'DEFAUL_USER_LASTNAME'
,
SITE_TITLE
)
purist/models.py
View file @
2f9525dd
...
...
@@ -184,7 +184,7 @@ class User(AbstractUser):
def
get_woocommerce_id
(
self
):
query
=
"customers?role=all&email="
+
self
.
get_identity
()
query
=
"customers?role=all&
limit=1&
email="
+
self
.
get_identity
()
json
=
self
.
woo_get_json
(
query
)
if
json
is
not
None
and
len
(
json
)
==
1
:
...
...
@@ -199,7 +199,7 @@ class User(AbstractUser):
data
=
{
"email"
:
self
.
get_identity
(),
"first_name"
:
self
.
username
,
"last_name"
:
settings
.
DEFAUL_USER_LASTNAME
,
"last_name"
:
"@"
+
settings
.
SITE_DOMAIN
,
"username"
:
self
.
get_identity
(),
"password"
:
make_password
(
None
),
# unusable password
"billing"
:
{
"email"
:
self
.
email
}
...
...
Write
Preview
Supports
Markdown
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