From 506679b8a011e5131ce17e4568059f74bb3d8c22 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sun, 3 Feb 2019 13:55:34 +0100 Subject: [PATCH] Bugfix: TypeError: write() argument must be str, not int Internal Server Error: /ipv6/work/signup/ Traceback (most recent call last): File "/home/app/pyvenv/lib/python3.5/site-packages/django/core/handlers/exception.py", line 34, in inner response = get_response(request) File "/home/app/pyvenv/lib/python3.5/site-packages/django/core/handlers/base.py", line 126, in _get_response response = self.process_exception_by_middleware(e, request) File "/home/app/pyvenv/lib/python3.5/site-packages/django/core/handlers/base.py", line 124, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "./users/views.py", line 19, in signup create_user(username, raw_password, first_name, last_name, email) File "./users/ldap_funcs.py", line 38, in create_user set_max_uid(uidNumber) File "./users/ldap_funcs.py", line 68, in set_max_uid handler.write(max_uid) TypeError: write() argument must be str, not int --- users/ldap_funcs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/users/ldap_funcs.py b/users/ldap_funcs.py index 1fe25a8..8e8d189 100644 --- a/users/ldap_funcs.py +++ b/users/ldap_funcs.py @@ -65,7 +65,7 @@ def set_max_uid(max_uid): :return: """ with open(settings.LDAP_MAX_UID_PATH, 'w+') as handler: - handler.write(max_uid) + handler.write(str(max_uid)) def get_max_uid():