Skip to content

Commit

Permalink
fix pylint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam-Cordry committed Sep 19, 2024
1 parent 3c00750 commit c8d8db7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
9 changes: 1 addition & 8 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ disable =
duplicate-code,
no-member,
parse-error,
bad-continuation,
too-few-public-methods,
global-statement,
cyclic-import,
Expand All @@ -18,14 +17,11 @@ disable =

[REPORTS]
output-format = text
files-output = no
reports = no

[FORMAT]
max-line-length = 120
max-statement-lines = 75
single-line-if-stmt = no
no-space-check = trailing-comma,dict-separator
max-module-lines = 1000
indent-string = ' '

Expand Down Expand Up @@ -73,9 +69,6 @@ good-names=logger,id,ID
# Bad variable names which should always be refused, separated by a comma
bad-names=foo,bar,baz,toto,tutu,tata

# List of builtins function names that should not be used, separated by a comma
bad-functions=apply,input

[DESIGN]
max-args = 10
ignored-argument-names = _.*
Expand All @@ -89,4 +82,4 @@ min-public-methods = 2
max-public-methods = 20

[EXCEPTIONS]
overgeneral-exceptions = Exception
overgeneral-exceptions = builtins.Exception
6 changes: 3 additions & 3 deletions profiles/ldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ def ldap_search_members(query):

for uid in res:
try:
mem = (str(uid[1]).split('\'')[3])
mem = str(uid[1]).split('\'')[3]
ret.append(ldap_get_member(mem))
except IndexError:
continue
Expand All @@ -398,7 +398,7 @@ def ldap_get_year(year):

for uid in res:
try:
mem = (str(uid[1]).split('\'')[3])
mem = str(uid[1]).split('\'')[3]
ret.append(ldap_get_member(mem))
except IndexError:
continue
Expand Down Expand Up @@ -464,7 +464,7 @@ def get_gravatar(uid=None):

@lru_cache(maxsize=1024)
def proxy_image(url):
response = requests.get(url)
response = requests.get(url, timeout=10)
img = Image.open(BytesIO(response.content))
with BytesIO() as output:
img.save(output, format="png")
Expand Down
2 changes: 1 addition & 1 deletion profiles/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def wrapped_function(*args, **kwargs):
"uid": uid,
"user_obj": user_obj,
"member_info": get_member_info(uid),
"color": requests.get('https://themeswitcher.csh.rit.edu/api/colour').content,
"color": requests.get('https://themeswitcher.csh.rit.edu/api/colour', timeout=10).content,
"current_year": parse_account_year(str(datetime.datetime.now().strftime("%Y%m"))),
"rtp": ldap_is_rtp(user_obj)
}
Expand Down

0 comments on commit c8d8db7

Please sign in to comment.