Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
uffd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Luca (strifel)
uffd
Commits
ffd34c35
Verified
Commit
ffd34c35
authored
4 years ago
by
nd
Browse files
Options
Downloads
Patches
Plain Diff
fixed pylint errors
parent
e4ffe340
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.pylintrc
+1
-1
1 addition, 1 deletion
.pylintrc
uffd/mail/models.py
+4
-7
4 additions, 7 deletions
uffd/mail/models.py
uffd/mail/views.py
+2
-3
2 additions, 3 deletions
uffd/mail/views.py
with
7 additions
and
11 deletions
.pylintrc
+
1
−
1
View file @
ffd34c35
...
...
@@ -203,7 +203,7 @@ ignore-docstrings=yes
ignore-imports=no
# Minimum lines number of a similarity.
min-similarity-lines=
4
min-similarity-lines=
6
[TYPECHECK]
...
...
This diff is collapsed.
Click to expand it.
uffd/mail/models.py
+
4
−
7
View file @
ffd34c35
import
secrets
from
ldap3
import
MODIFY_REPLACE
,
MODIFY_DELETE
,
MODIFY_ADD
,
HASHED_SALTED_SHA512
from
ldap3
import
MODIFY_REPLACE
from
flask
import
current_app
from
uffd
import
ldap
class
Mail
():
def
__init__
(
self
,
uid
=
None
,
destinations
=
[]
,
receivers
=
[]
,
dn
=
None
):
def
__init__
(
self
,
uid
=
None
,
destinations
=
None
,
receivers
=
None
,
dn
=
None
):
self
.
uid
=
uid
self
.
receivers
=
receivers
self
.
destinations
=
destinations
self
.
receivers
=
receivers
if
receivers
else
[]
self
.
destinations
=
destinations
if
destinations
else
[]
self
.
dn
=
dn
@classmethod
...
...
@@ -47,4 +45,3 @@ class Mail():
}
result
=
conn
.
modify
(
self
.
dn
,
attributes
)
return
result
This diff is collapsed.
Click to expand it.
uffd/mail/views.py
+
2
−
3
View file @
ffd34c35
...
...
@@ -26,7 +26,6 @@ def index():
mails
=
[]
for
i
in
conn
.
entries
:
mails
.
append
(
Mail
.
from_ldap
(
i
))
print
(
mails
)
return
render_template
(
'
mail_list.html
'
,
mails
=
mails
)
@bp.route
(
"
/<uid>
"
)
...
...
@@ -57,8 +56,8 @@ def update(uid=False):
if
is_newmail
:
mail
.
uid
=
request
.
form
.
get
(
'
mail-uid
'
)
mail
.
receivers
=
request
.
form
.
get
(
'
mail-receivers
'
,
''
).
splitlines
()
;
mail
.
destinations
=
request
.
form
.
get
(
'
mail-destinations
'
,
''
).
splitlines
()
;
mail
.
receivers
=
request
.
form
.
get
(
'
mail-receivers
'
,
''
).
splitlines
()
mail
.
destinations
=
request
.
form
.
get
(
'
mail-destinations
'
,
''
).
splitlines
()
if
mail
.
to_ldap
(
new
=
is_newmail
):
flash
(
'
Mail mapping updated.
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment