· 6 years ago · Jul 01, 2019, 02:18 PM
1IntegrityError at /api/v1/accounts/register
2null value in column "is_available" violates not-null constraint
3DETAIL: Failing row contains (114, pbkdf2_sha256$150000$jqhEPM57Kjt4$f5C44qAQ3WUxkElwWrm6tf7BBkP2Ub..., null, f, 2019-07-01 14:12:14.262404+00, 2019-07-01 14:12:14.418081+00, f, t, f, f, nooookie@example.io, null, null, TALENT, null, null, c89869a7-5909-49b6-9caf-ae75447c4769, null, null, null, null).
4Request Method: POST
5Request URL: http://nookie1-staging.herokuapp.com/api/v1/accounts/register
6Django Version: 2.2.1
7Exception Type: IntegrityError
8Exception Value:
9null value in column "is_available" violates not-null constraint
10DETAIL: Failing row contains (114, pbkdf2_sha256$150000$jqhEPM57Kjt4$f5C44qAQ3WUxkElwWrm6tf7BBkP2Ub..., null, f, 2019-07-01 14:12:14.262404+00, 2019-07-01 14:12:14.418081+00, f, t, f, f, nooookie@example.io, null, null, TALENT, null, null, c89869a7-5909-49b6-9caf-ae75447c4769, null, null, null, null).
11Exception Location: /usr/local/lib/python3.7/site-packages/django/db/backends/utils.py in _execute, line 84
12Python Executable: /usr/local/bin/python
13Python Version: 3.7.3
14Python Path:
15['/code/src',
16 '/usr/local/bin',
17 '/usr/local/lib/python37.zip',
18 '/usr/local/lib/python3.7',
19 '/usr/local/lib/python3.7/lib-dynload',
20 '/usr/local/lib/python3.7/site-packages']
21Server time: Mon, 1 Jul 2019 14:12:14 +0000
22Traceback Switch to copy-and-paste view
23/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py in _execute
24 def _execute(self, sql, params, *ignored_wrapper_args):
25 self.db.validate_no_broken_transaction()
26 with self.db.wrap_database_errors:
27 if params is None:
28 return self.cursor.execute(sql)
29 else:
30 return self.cursor.execute(sql, params) …
31 def _executemany(self, sql, param_list, *ignored_wrapper_args):
32 self.db.validate_no_broken_transaction()
33 with self.db.wrap_database_errors:
34 return self.cursor.executemany(sql, param_list)
35▶ Local vars
36Variable Value
37ignored_wrapper_args
38(False,
39 {'connection': <django.db.backends.postgresql.base.DatabaseWrapper object at 0x7f1eced33cf8>,
40 'cursor': <django.db.backends.utils.CursorDebugWrapper object at 0x7f1ecc16db38>})
41params
42('pbkdf2_sha256$150000$jqhEPM57Kjt4$f5C44qAQ3WUxkElwWrm6tf7BBkP2Ub0507gzQPSVTA8=',
43 None,
44 False,
45 datetime.datetime(2019, 7, 1, 14, 12, 14, 262404, tzinfo=<UTC>),
46 datetime.datetime(2019, 7, 1, 14, 12, 14, 418081, tzinfo=<UTC>),
47 False,
48 True,
49 False,
50 False,
51 'nooookie@example.io',
52 'TALENT',
53 UUID('c89869a7-5909-49b6-9caf-ae75447c4769'))
54self
55<django.db.backends.utils.CursorDebugWrapper object at 0x7f1ecc16db38>
56sql
57('INSERT INTO "accounts_user" ("password", "last_login", "is_superuser", '
58 '"created_at", "updated_at", "is_staff", "is_active", "is_email_verified", '
59 '"is_account_verified", "email", "role", "jwt_secret") VALUES (%s, %s, %s, '
60 '%s, %s, %s, %s, %s, %s, %s, %s, %s) RETURNING "accounts_user"."id"')
61The above exception (null value in column "is_available" violates not-null constraint DETAIL: Failing row contains (114, pbkdf2_sha256$150000$jqhEPM57Kjt4$f5C44qAQ3WUxkElwWrm6tf7BBkP2Ub..., null, f, 2019-07-01 14:12:14.262404+00, 2019-07-01 14:12:14.418081+00, f, t, f, f, nooookie@example.io, null, null, TALENT, null, null, c89869a7-5909-49b6-9caf-ae75447c4769, null, null, null, null). ) was the direct cause of the following exception:
62/usr/local/lib/python3.7/site-packages/django/core/handlers/exception.py in inner
63 This decorator is automatically applied to all middleware to ensure that
64 no middleware leaks an exception and that the next middleware in the stack
65 can rely on getting a response instead of an exception.
66 """
67 @wraps(get_response)
68 def inner(request):
69 try:
70 response = get_response(request) …
71 except Exception as exc:
72 response = response_for_exception(request, exc)
73 return response
74 return inner
75▶ Local vars
76Variable Value
77exc
78IntegrityError('null value in column "is_available" violates not-null constraint\nDETAIL: Failing row contains (114, pbkdf2_sha256$150000$jqhEPM57Kjt4$f5C44qAQ3WUxkElwWrm6tf7BBkP2Ub..., null, f, 2019-07-01 14:12:14.262404+00, 2019-07-01 14:12:14.418081+00, f, t, f, f, nooookie@example.io, null, null, TALENT, null, null, c89869a7-5909-49b6-9caf-ae75447c4769, null, null, null, null).\n')
79get_response
80<bound method BaseHandler._get_response of <django.core.handlers.wsgi.WSGIHandler object at 0x7f1ecdd51c18>>
81request
82<WSGIRequest: POST '/api/v1/accounts/register'>
83/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py in _get_response
84 break
85 if response is None:
86 wrapped_callback = self.make_view_atomic(callback)
87 try:
88 response = wrapped_callback(request, *callback_args, **callback_kwargs)
89 except Exception as e:
90 response = self.process_exception_by_middleware(e, request) …
91 # Complain if the view returned None (a common error).
92 if response is None:
93 if isinstance(callback, types.FunctionType): # FBV
94 view_name = callback.__name__
95 else: # CBV
96▶ Local vars
97Variable Value
98callback
99<function RegisterAPIView at 0x7f1eccc15488>
100callback_args
101()
102callback_kwargs
103{}
104middleware_method
105<bound method CsrfViewMiddleware.process_view of <django.middleware.csrf.CsrfViewMiddleware object at 0x7f1ecd57fef0>>
106request
107<WSGIRequest: POST '/api/v1/accounts/register'>
108resolver
109<URLResolver 'config.urls' (None:None) '^/'>
110resolver_match
111ResolverMatch(func=accounts.views.RegisterAPIView, args=(), kwargs={}, url_name=None, app_names=['accounts'], namespaces=['accounts'], route=api/v1/accounts/register)
112response
113None
114self
115<django.core.handlers.wsgi.WSGIHandler object at 0x7f1ecdd51c18>
116wrapped_callback
117<function RegisterAPIView at 0x7f1eccc15488>
118/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py in _get_response
119 response = middleware_method(request, callback, callback_args, callback_kwargs)
120 if response:
121 break
122 if response is None:
123 wrapped_callback = self.make_view_atomic(callback)
124 try:
125 response = wrapped_callback(request, *callback_args, **callback_kwargs) …
126 except Exception as e:
127 response = self.process_exception_by_middleware(e, request)
128 # Complain if the view returned None (a common error).
129 if response is None:
130 if isinstance(callback, types.FunctionType): # FBV
131▶ Local vars
132Variable Value
133callback
134<function RegisterAPIView at 0x7f1eccc15488>
135callback_args
136()
137callback_kwargs
138{}
139middleware_method
140<bound method CsrfViewMiddleware.process_view of <django.middleware.csrf.CsrfViewMiddleware object at 0x7f1ecd57fef0>>
141request
142<WSGIRequest: POST '/api/v1/accounts/register'>
143resolver
144<URLResolver 'config.urls' (None:None) '^/'>
145resolver_match
146ResolverMatch(func=accounts.views.RegisterAPIView, args=(), kwargs={}, url_name=None, app_names=['accounts'], namespaces=['accounts'], route=api/v1/accounts/register)
147response
148None
149self
150<django.core.handlers.wsgi.WSGIHandler object at 0x7f1ecdd51c18>
151wrapped_callback
152<function RegisterAPIView at 0x7f1eccc15488>
153/usr/local/lib/python3.7/site-packages/django/views/decorators/csrf.py in wrapped_view
154def csrf_exempt(view_func):
155 """Mark a view function as being exempt from the CSRF view protection."""
156 # view_func.csrf_exempt = True would also work, but decorators are nicer
157 # if they don't have side effects, so return a new function.
158 def wrapped_view(*args, **kwargs):
159 return view_func(*args, **kwargs) …
160 wrapped_view.csrf_exempt = True
161 return wraps(view_func)(wrapped_view)
162▶ Local vars
163Variable Value
164args
165(<WSGIRequest: POST '/api/v1/accounts/register'>,)
166kwargs
167{}
168view_func
169<function RegisterAPIView at 0x7f1eccc15400>
170/usr/local/lib/python3.7/site-packages/django/views/generic/base.py in view
171 self.head = self.get
172 self.setup(request, *args, **kwargs)
173 if not hasattr(self, 'request'):
174 raise AttributeError(
175 "%s instance has no 'request' attribute. Did you override "
176 "setup() and forget to call super()?" % cls.__name__
177 )
178 return self.dispatch(request, *args, **kwargs) …
179 view.view_class = cls
180 view.view_initkwargs = initkwargs
181 # take name and docstring from class
182 update_wrapper(view, cls, updated=())
183▶ Local vars
184Variable Value
185args
186()
187cls
188<class 'accounts.views.RegisterAPIView'>
189initkwargs
190{}
191kwargs
192{}
193request
194<WSGIRequest: POST '/api/v1/accounts/register'>
195self
196<accounts.views.RegisterAPIView object at 0x7f1ecc16d2e8>
197/usr/local/lib/python3.7/site-packages/rest_framework/views.py in dispatch
198 self.http_method_not_allowed)
199 else:
200 handler = self.http_method_not_allowed
201 response = handler(request, *args, **kwargs)
202 except Exception as exc:
203 response = self.handle_exception(exc) …
204 self.response = self.finalize_response(request, response, *args, **kwargs)
205 return self.response
206 def options(self, request, *args, **kwargs):
207 """
208▶ Local vars
209Variable Value
210args
211()
212handler
213<bound method RegisterAPIView.post of <accounts.views.RegisterAPIView object at 0x7f1ecc16d2e8>>
214kwargs
215{}
216request
217<rest_framework.request.Request object at 0x7f1ecc16d3c8>
218self
219<accounts.views.RegisterAPIView object at 0x7f1ecc16d2e8>
220/usr/local/lib/python3.7/site-packages/rest_framework/views.py in handle_exception
221 exc.auth_header = auth_header
222 else:
223 exc.status_code = status.HTTP_403_FORBIDDEN
224 exception_handler = self.get_exception_handler()
225 context = self.get_exception_handler_context()
226 response = exception_handler(exc, context) …
227 if response is None:
228 self.raise_uncaught_exception(exc)
229 response.exception = True
230 return response
231▶ Local vars
232Variable Value
233context
234{'args': (),
235 'kwargs': {},
236 'request': <rest_framework.request.Request object at 0x7f1ecc16d3c8>,
237 'view': <accounts.views.RegisterAPIView object at 0x7f1ecc16d2e8>}
238exc
239IntegrityError('null value in column "is_available" violates not-null constraint\nDETAIL: Failing row contains (114, pbkdf2_sha256$150000$jqhEPM57Kjt4$f5C44qAQ3WUxkElwWrm6tf7BBkP2Ub..., null, f, 2019-07-01 14:12:14.262404+00, 2019-07-01 14:12:14.418081+00, f, t, f, f, nooookie@example.io, null, null, TALENT, null, null, c89869a7-5909-49b6-9caf-ae75447c4769, null, null, null, null).\n')
240exception_handler
241<function custom_exception_handler at 0x7f1eccb949d8>
242self
243<accounts.views.RegisterAPIView object at 0x7f1ecc16d2e8>
244/code/src/core/exceptions.py in custom_exception_handler
245 detail = []
246 detail_fields = {}
247 is_serialization_error = isinstance(exc, ValidationError)
248 # response is None if there is unhandled exception
249 if not response:
250 if settings.DEBUG:
251 raise exc …
252 return Response(
253 {'detail': 'Internal Server Error'},
254 status=status.HTTP_500_INTERNAL_SERVER_ERROR,
255 )
256▶ Local vars
257Variable Value
258context
259{'args': (),
260 'kwargs': {},
261 'request': <rest_framework.request.Request object at 0x7f1ecc16d3c8>,
262 'view': <accounts.views.RegisterAPIView object at 0x7f1ecc16d2e8>}
263detail
264[]
265detail_fields
266{}
267exc
268IntegrityError('null value in column "is_available" violates not-null constraint\nDETAIL: Failing row contains (114, pbkdf2_sha256$150000$jqhEPM57Kjt4$f5C44qAQ3WUxkElwWrm6tf7BBkP2Ub..., null, f, 2019-07-01 14:12:14.262404+00, 2019-07-01 14:12:14.418081+00, f, t, f, f, nooookie@example.io, null, null, TALENT, null, null, c89869a7-5909-49b6-9caf-ae75447c4769, null, null, null, null).\n')
269is_serialization_error
270False
271response
272None
273/usr/local/lib/python3.7/site-packages/rest_framework/views.py in dispatch
274 # Get the appropriate handler method
275 if request.method.lower() in self.http_method_names:
276 handler = getattr(self, request.method.lower(),
277 self.http_method_not_allowed)
278 else:
279 handler = self.http_method_not_allowed
280 response = handler(request, *args, **kwargs) …
281 except Exception as exc:
282 response = self.handle_exception(exc)
283 self.response = self.finalize_response(request, response, *args, **kwargs)
284 return self.response
285▶ Local vars
286Variable Value
287args
288()
289handler
290<bound method RegisterAPIView.post of <accounts.views.RegisterAPIView object at 0x7f1ecc16d2e8>>
291kwargs
292{}
293request
294<rest_framework.request.Request object at 0x7f1ecc16d3c8>
295self
296<accounts.views.RegisterAPIView object at 0x7f1ecc16d2e8>
297/code/src/accounts/views.py in post
298 manual_parameters=header_fields,
299 request_body=UserCreateSerializer,
300 responses={200: UserSerializer},
301 )
302 def post(self, request, *args, **kwargs):
303 serializer = UserCreateSerializer(data=request.data)
304 serializer.is_valid(raise_exception=True)
305 user = serializer.save() …
306 emails.send_activation_email(request, user)
307 serializer = UserSerializer(user)
308 return Response(serializer.data)
309▶ Local vars
310Variable Value
311args
312()
313kwargs
314{}
315request
316<rest_framework.request.Request object at 0x7f1ecc16d3c8>
317self
318<accounts.views.RegisterAPIView object at 0x7f1ecc16d2e8>
319serializer
320UserCreateSerializer(data={'email': 'nooookie@example.io', 'password': 'Q7bTGHuF0T', 'role': 'TALENT'}):
321 email = EmailField()
322 password = CharField(write_only=True)
323 role = CharField()
324/usr/local/lib/python3.7/site-packages/rest_framework/serializers.py in save
325 if self.instance is not None:
326 self.instance = self.update(self.instance, validated_data)
327 assert self.instance is not None, (
328 '`update()` did not return an object instance.'
329 )
330 else:
331 self.instance = self.create(validated_data) …
332 assert self.instance is not None, (
333 '`create()` did not return an object instance.'
334 )
335 return self.instance
336▶ Local vars
337Variable Value
338kwargs
339{}
340self
341UserCreateSerializer(data={'email': 'nooookie@example.io', 'password': 'Q7bTGHuF0T', 'role': 'TALENT'}):
342 email = EmailField()
343 password = CharField(write_only=True)
344 role = CharField()
345validated_data
346{'email': 'nooookie@example.io',
347 'password': 'Q7bTGHuF0T',
348 'role': <UserType.TALENT: 'TALENT'>}
349/code/src/accounts/serializers.py in create
350 password_validation.validate_password(value, self.instance)
351 return value
352 def validate_role(self, value):
353 return validate_enum_type(UserType, value)
354 def create(self, validated_data):
355 user = User.objects.create_user(**validated_data) …
356 if user.role == UserType.TALENT:
357 Talent.objects.create(user=user)
358 elif user.role == UserType.CLUB:
359 Club.objects.create(user=user)
360 return user
361▶ Local vars
362Variable Value
363self
364UserCreateSerializer(data={'email': 'nooookie@example.io', 'password': 'Q7bTGHuF0T', 'role': 'TALENT'}):
365 email = EmailField()
366 password = CharField(write_only=True)
367 role = CharField()
368validated_data
369{'email': 'nooookie@example.io',
370 'password': 'Q7bTGHuF0T',
371 'role': <UserType.TALENT: 'TALENT'>}
372/code/src/accounts/models.py in create_user
373 def create_user(self, email: str, password: str, **kwargs: Dict) -> 'User':
374 """
375 Create normal user.
376 """
377 kwargs.setdefault('is_superuser', False)
378 return self._create_user(email, password, **kwargs) …
379 def create_superuser(self, email: str, password: str, **kwargs: Dict) -> 'User':
380 """
381 Create super user.
382 """
383 kwargs.setdefault('is_staff', True)
384▶ Local vars
385Variable Value
386email
387'nooookie@example.io'
388kwargs
389{'is_superuser': False, 'role': <UserType.TALENT: 'TALENT'>}
390password
391'Q7bTGHuF0T'
392self
393<accounts.models.UserManagerActive object at 0x7f1ecd58e048>
394/code/src/accounts/models.py in _create_user
395 raise ValueError('Email is required.')
396 if not password:
397 raise ValueError('Password is required.')
398 email = self.normalize_email(email)
399 user = self.model(email=email.lower(), **kwargs)
400 user.set_password(password)
401 user.save(using=self._db) …
402 return user
403 def create_user(self, email: str, password: str, **kwargs: Dict) -> 'User':
404 """
405 Create normal user.
406 """
407▶ Local vars
408Variable Value
409email
410'nooookie@example.io'
411kwargs
412{'is_superuser': False, 'role': <UserType.TALENT: 'TALENT'>}
413password
414'Q7bTGHuF0T'
415self
416<accounts.models.UserManagerActive object at 0x7f1ecd58e048>
417user
418<User: nooookie@example.io>
419/usr/local/lib/python3.7/site-packages/django/contrib/auth/base_user.py in save
420 class Meta:
421 abstract = True
422 def __str__(self):
423 return self.get_username()
424 def save(self, *args, **kwargs):
425 super().save(*args, **kwargs) …
426 if self._password is not None:
427 password_validation.password_changed(self._password, self)
428 self._password = None
429 def get_username(self):
430 """Return the username for this User."""
431▶ Local vars
432Variable Value
433__class__
434<class 'django.contrib.auth.base_user.AbstractBaseUser'>
435args
436()
437kwargs
438{'using': None}
439self
440<User: nooookie@example.io>
441/usr/local/lib/python3.7/site-packages/django/db/models/base.py in save
442 if not field.primary_key and not hasattr(field, 'through'):
443 field_names.add(field.attname)
444 loaded_fields = field_names.difference(deferred_fields)
445 if loaded_fields:
446 update_fields = frozenset(loaded_fields)
447 self.save_base(using=using, force_insert=force_insert,
448 force_update=force_update, update_fields=update_fields) …
449 save.alters_data = True
450 def save_base(self, raw=False, force_insert=False,
451 force_update=False, using=None, update_fields=None):
452 """
453 Handle the parts of saving which should be done only once per save,
454▶ Local vars
455Variable Value
456deferred_fields
457set()
458field
459<django.db.models.fields.UUIDField: jwt_secret>
460force_insert
461False
462force_update
463False
464self
465<User: nooookie@example.io>
466update_fields
467None
468using
469'default'
470/usr/local/lib/python3.7/site-packages/django/db/models/base.py in save_base
471 context_manager = transaction.mark_for_rollback_on_error(using=using)
472 with context_manager:
473 parent_inserted = False
474 if not raw:
475 parent_inserted = self._save_parents(cls, using, update_fields)
476 updated = self._save_table(
477 raw, cls, force_insert or parent_inserted,
478 force_update, using, update_fields, …
479 )
480 # Store the database on which the object was saved
481 self._state.db = using
482 # Once saved, this is no longer a to-be-added instance.
483 self._state.adding = False
484▶ Local vars
485Variable Value
486cls
487<class 'accounts.models.User'>
488context_manager
489<contextlib._GeneratorContextManager object at 0x7f1ecc16d7b8>
490force_insert
491False
492force_update
493False
494meta
495<Options for User>
496origin
497<class 'accounts.models.User'>
498parent_inserted
499False
500raw
501False
502self
503<User: nooookie@example.io>
504update_fields
505None
506using
507'default'
508/usr/local/lib/python3.7/site-packages/django/db/models/base.py in _save_table
509 self._order = order_value
510 fields = meta.local_concrete_fields
511 if not pk_set:
512 fields = [f for f in fields if f is not meta.auto_field]
513 update_pk = meta.auto_field and not pk_set
514 result = self._do_insert(cls._base_manager, using, fields, update_pk, raw) …
515 if update_pk:
516 setattr(self, meta.pk.attname, result)
517 return updated
518 def _do_update(self, base_qs, using, pk_val, values, update_fields, forced_update):
519 """
520▶ Local vars
521Variable Value
522cls
523<class 'accounts.models.User'>
524fields
525[<django.db.models.fields.CharField: password>,
526 <django.db.models.fields.DateTimeField: last_login>,
527 <django.db.models.fields.BooleanField: is_superuser>,
528 <django.db.models.fields.DateTimeField: created_at>,
529 <django.db.models.fields.DateTimeField: updated_at>,
530 <django.db.models.fields.BooleanField: is_staff>,
531 <django.db.models.fields.BooleanField: is_active>,
532 <django.db.models.fields.BooleanField: is_email_verified>,
533 <django.db.models.fields.BooleanField: is_account_verified>,
534 <django.db.models.fields.EmailField: email>,
535 <django.db.models.fields.CharField: role>,
536 <django.db.models.fields.UUIDField: jwt_secret>]
537force_insert
538False
539force_update
540False
541meta
542<Options for User>
543non_pks
544[<django.db.models.fields.CharField: password>,
545 <django.db.models.fields.DateTimeField: last_login>,
546 <django.db.models.fields.BooleanField: is_superuser>,
547 <django.db.models.fields.DateTimeField: created_at>,
548 <django.db.models.fields.DateTimeField: updated_at>,
549 <django.db.models.fields.BooleanField: is_staff>,
550 <django.db.models.fields.BooleanField: is_active>,
551 <django.db.models.fields.BooleanField: is_email_verified>,
552 <django.db.models.fields.BooleanField: is_account_verified>,
553 <django.db.models.fields.EmailField: email>,
554 <django.db.models.fields.CharField: role>,
555 <django.db.models.fields.UUIDField: jwt_secret>]
556pk_set
557False
558pk_val
559None
560raw
561False
562self
563<User: nooookie@example.io>
564update_fields
565None
566update_pk
567True
568updated
569False
570using
571'default'
572/usr/local/lib/python3.7/site-packages/django/db/models/base.py in _do_insert
573 def _do_insert(self, manager, using, fields, update_pk, raw):
574 """
575 Do an INSERT. If update_pk is defined then this method should return
576 the new pk for the model.
577 """
578 return manager._insert([self], fields=fields, return_id=update_pk,
579 using=using, raw=raw) …
580 def delete(self, using=None, keep_parents=False):
581 using = using or router.db_for_write(self.__class__, instance=self)
582 assert self.pk is not None, (
583 "%s object can't be deleted because its %s attribute is set to None." %
584 (self._meta.object_name, self._meta.pk.attname)
585▶ Local vars
586Variable Value
587fields
588[<django.db.models.fields.CharField: password>,
589 <django.db.models.fields.DateTimeField: last_login>,
590 <django.db.models.fields.BooleanField: is_superuser>,
591 <django.db.models.fields.DateTimeField: created_at>,
592 <django.db.models.fields.DateTimeField: updated_at>,
593 <django.db.models.fields.BooleanField: is_staff>,
594 <django.db.models.fields.BooleanField: is_active>,
595 <django.db.models.fields.BooleanField: is_email_verified>,
596 <django.db.models.fields.BooleanField: is_account_verified>,
597 <django.db.models.fields.EmailField: email>,
598 <django.db.models.fields.CharField: role>,
599 <django.db.models.fields.UUIDField: jwt_secret>]
600manager
601<django.db.models.manager.Manager object at 0x7f1ecc16d908>
602raw
603False
604self
605<User: nooookie@example.io>
606update_pk
607True
608using
609'default'
610/usr/local/lib/python3.7/site-packages/django/db/models/manager.py in manager_method
611 def check(self, **kwargs):
612 return []
613 @classmethod
614 def _get_queryset_methods(cls, queryset_class):
615 def create_method(name, method):
616 def manager_method(self, *args, **kwargs):
617 return getattr(self.get_queryset(), name)(*args, **kwargs) …
618 manager_method.__name__ = method.__name__
619 manager_method.__doc__ = method.__doc__
620 return manager_method
621 new_methods = {}
622 for name, method in inspect.getmembers(queryset_class, predicate=inspect.isfunction):
623▶ Local vars
624Variable Value
625args
626([<User: nooookie@example.io>],)
627kwargs
628{'fields': [<django.db.models.fields.CharField: password>,
629 <django.db.models.fields.DateTimeField: last_login>,
630 <django.db.models.fields.BooleanField: is_superuser>,
631 <django.db.models.fields.DateTimeField: created_at>,
632 <django.db.models.fields.DateTimeField: updated_at>,
633 <django.db.models.fields.BooleanField: is_staff>,
634 <django.db.models.fields.BooleanField: is_active>,
635 <django.db.models.fields.BooleanField: is_email_verified>,
636 <django.db.models.fields.BooleanField: is_account_verified>,
637 <django.db.models.fields.EmailField: email>,
638 <django.db.models.fields.CharField: role>,
639 <django.db.models.fields.UUIDField: jwt_secret>],
640 'raw': False,
641 'return_id': True,
642 'using': 'default'}
643name
644'_insert'
645self
646<django.db.models.manager.Manager object at 0x7f1ecc16d908>
647/usr/local/lib/python3.7/site-packages/django/db/models/query.py in _insert
648 the InsertQuery class and is how Model.save() is implemented.
649 """
650 self._for_write = True
651 if using is None:
652 using = self.db
653 query = sql.InsertQuery(self.model, ignore_conflicts=ignore_conflicts)
654 query.insert_values(fields, objs, raw=raw)
655 return query.get_compiler(using=using).execute_sql(return_id) …
656 _insert.alters_data = True
657 _insert.queryset_only = False
658 def _batched_insert(self, objs, fields, batch_size, ignore_conflicts=False):
659 """
660 Helper method for bulk_create() to insert objs one batch at a time.
661▶ Local vars
662Variable Value
663fields
664[<django.db.models.fields.CharField: password>,
665 <django.db.models.fields.DateTimeField: last_login>,
666 <django.db.models.fields.BooleanField: is_superuser>,
667 <django.db.models.fields.DateTimeField: created_at>,
668 <django.db.models.fields.DateTimeField: updated_at>,
669 <django.db.models.fields.BooleanField: is_staff>,
670 <django.db.models.fields.BooleanField: is_active>,
671 <django.db.models.fields.BooleanField: is_email_verified>,
672 <django.db.models.fields.BooleanField: is_account_verified>,
673 <django.db.models.fields.EmailField: email>,
674 <django.db.models.fields.CharField: role>,
675 <django.db.models.fields.UUIDField: jwt_secret>]
676ignore_conflicts
677False
678objs
679[<User: nooookie@example.io>]
680query
681<django.db.models.sql.subqueries.InsertQuery object at 0x7f1ecc16da90>
682raw
683False
684return_id
685True
686self
687<QuerySet [<User: hughestara@garcia.com>, <User: lpadilla@hotmail.com>, <User: michael59@torres.com>, <User: evincent@hayden-buckley.info>, <User: jdunn@obrien.org>, <User: jacksondaniel@morgan-hanson.com>, <User: justin75@gmail.com>, <User: lopezmatthew@hotmail.com>, <User: tpreston@perez-shepherd.com>, <User: francesrivera@yahoo.com>, <User: george10@yahoo.com>, <User: lauren85@gmail.com>, <User: webergary@yahoo.com>, <User: ann77@yahoo.com>, <User: tracibrown@short-davis.com>, <User: johnsonstephanie@yahoo.com>, <User: christinaporter@hotmail.com>, <User: alexandervaldez@yahoo.com>, <User: schristensen@hotmail.com>, <User: jennifer68@hotmail.com>, '...(remaining elements truncated)...']>
688using
689'default'
690/usr/local/lib/python3.7/site-packages/django/db/models/sql/compiler.py in execute_sql
691 assert not (
692 return_id and len(self.query.objs) != 1 and
693 not self.connection.features.can_return_ids_from_bulk_insert
694 )
695 self.return_id = return_id
696 with self.connection.cursor() as cursor:
697 for sql, params in self.as_sql():
698 cursor.execute(sql, params) …
699 if not return_id:
700 return
701 if self.connection.features.can_return_ids_from_bulk_insert and len(self.query.objs) > 1:
702 return self.connection.ops.fetch_returned_insert_ids(cursor)
703 if self.connection.features.can_return_id_from_insert:
704 assert len(self.query.objs) == 1
705▶ Local vars
706Variable Value
707cursor
708<django.db.backends.utils.CursorDebugWrapper object at 0x7f1ecc16db38>
709params
710('pbkdf2_sha256$150000$jqhEPM57Kjt4$f5C44qAQ3WUxkElwWrm6tf7BBkP2Ub0507gzQPSVTA8=',
711 None,
712 False,
713 datetime.datetime(2019, 7, 1, 14, 12, 14, 262404, tzinfo=<UTC>),
714 datetime.datetime(2019, 7, 1, 14, 12, 14, 418081, tzinfo=<UTC>),
715 False,
716 True,
717 False,
718 False,
719 'nooookie@example.io',
720 'TALENT',
721 UUID('c89869a7-5909-49b6-9caf-ae75447c4769'))
722return_id
723True
724self
725<django.db.models.sql.compiler.SQLInsertCompiler object at 0x7f1ecc16db00>
726sql
727('INSERT INTO "accounts_user" ("password", "last_login", "is_superuser", '
728 '"created_at", "updated_at", "is_staff", "is_active", "is_email_verified", '
729 '"is_account_verified", "email", "role", "jwt_secret") VALUES (%s, %s, %s, '
730 '%s, %s, %s, %s, %s, %s, %s, %s, %s) RETURNING "accounts_user"."id"')
731/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py in execute
732class CursorDebugWrapper(CursorWrapper):
733 # XXX callproc isn't instrumented at this time.
734 def execute(self, sql, params=None):
735 start = time()
736 try:
737 return super().execute(sql, params) …
738 finally:
739 stop = time()
740 duration = stop - start
741 sql = self.db.ops.last_executed_query(self.cursor, sql, params)
742 self.db.queries_log.append({
743 'sql': sql,
744▶ Local vars
745Variable Value
746__class__
747<class 'django.db.backends.utils.CursorDebugWrapper'>
748duration
7490.005013704299926758
750params
751('pbkdf2_sha256$150000$jqhEPM57Kjt4$f5C44qAQ3WUxkElwWrm6tf7BBkP2Ub0507gzQPSVTA8=',
752 None,
753 False,
754 datetime.datetime(2019, 7, 1, 14, 12, 14, 262404, tzinfo=<UTC>),
755 datetime.datetime(2019, 7, 1, 14, 12, 14, 418081, tzinfo=<UTC>),
756 False,
757 True,
758 False,
759 False,
760 'nooookie@example.io',
761 'TALENT',
762 UUID('c89869a7-5909-49b6-9caf-ae75447c4769'))
763self
764<django.db.backends.utils.CursorDebugWrapper object at 0x7f1ecc16db38>
765sql
766('INSERT INTO "accounts_user" ("password", "last_login", "is_superuser", '
767 '"created_at", "updated_at", "is_staff", "is_active", "is_email_verified", '
768 '"is_account_verified", "email", "role", "jwt_secret") VALUES '
769 "('pbkdf2_sha256$150000$jqhEPM57Kjt4$f5C44qAQ3WUxkElwWrm6tf7BBkP2Ub0507gzQPSVTA8=', "
770 "NULL, false, '2019-07-01T14:12:14.262404+00:00'::timestamptz, "
771 "'2019-07-01T14:12:14.418081+00:00'::timestamptz, false, true, false, false, "
772 "'nooookie@example.io', 'TALENT', "
773 "'c89869a7-5909-49b6-9caf-ae75447c4769'::uuid) RETURNING "
774 '"accounts_user"."id"')
775start
7761561990334.4182398
777stop
7781561990334.4232535
779/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py in execute
780 elif kparams is None:
781 return self.cursor.callproc(procname, params)
782 else:
783 params = params or ()
784 return self.cursor.callproc(procname, params, kparams)
785 def execute(self, sql, params=None):
786 return self._execute_with_wrappers(sql, params, many=False, executor=self._execute) …
787 def executemany(self, sql, param_list):
788 return self._execute_with_wrappers(sql, param_list, many=True, executor=self._executemany)
789 def _execute_with_wrappers(self, sql, params, many, executor):
790 context = {'connection': self.db, 'cursor': self}
791▶ Local vars
792Variable Value
793params
794('pbkdf2_sha256$150000$jqhEPM57Kjt4$f5C44qAQ3WUxkElwWrm6tf7BBkP2Ub0507gzQPSVTA8=',
795 None,
796 False,
797 datetime.datetime(2019, 7, 1, 14, 12, 14, 262404, tzinfo=<UTC>),
798 datetime.datetime(2019, 7, 1, 14, 12, 14, 418081, tzinfo=<UTC>),
799 False,
800 True,
801 False,
802 False,
803 'nooookie@example.io',
804 'TALENT',
805 UUID('c89869a7-5909-49b6-9caf-ae75447c4769'))
806self
807<django.db.backends.utils.CursorDebugWrapper object at 0x7f1ecc16db38>
808sql
809('INSERT INTO "accounts_user" ("password", "last_login", "is_superuser", '
810 '"created_at", "updated_at", "is_staff", "is_active", "is_email_verified", '
811 '"is_account_verified", "email", "role", "jwt_secret") VALUES (%s, %s, %s, '
812 '%s, %s, %s, %s, %s, %s, %s, %s, %s) RETURNING "accounts_user"."id"')
813/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py in _execute_with_wrappers
814 def executemany(self, sql, param_list):
815 return self._execute_with_wrappers(sql, param_list, many=True, executor=self._executemany)
816 def _execute_with_wrappers(self, sql, params, many, executor):
817 context = {'connection': self.db, 'cursor': self}
818 for wrapper in reversed(self.db.execute_wrappers):
819 executor = functools.partial(wrapper, executor)
820 return executor(sql, params, many, context) …
821 def _execute(self, sql, params, *ignored_wrapper_args):
822 self.db.validate_no_broken_transaction()
823 with self.db.wrap_database_errors:
824 if params is None:
825 return self.cursor.execute(sql)
826▶ Local vars
827Variable Value
828context
829{'connection': <django.db.backends.postgresql.base.DatabaseWrapper object at 0x7f1eced33cf8>,
830 'cursor': <django.db.backends.utils.CursorDebugWrapper object at 0x7f1ecc16db38>}
831executor
832<bound method CursorWrapper._execute of <django.db.backends.utils.CursorDebugWrapper object at 0x7f1ecc16db38>>
833many
834False
835params
836('pbkdf2_sha256$150000$jqhEPM57Kjt4$f5C44qAQ3WUxkElwWrm6tf7BBkP2Ub0507gzQPSVTA8=',
837 None,
838 False,
839 datetime.datetime(2019, 7, 1, 14, 12, 14, 262404, tzinfo=<UTC>),
840 datetime.datetime(2019, 7, 1, 14, 12, 14, 418081, tzinfo=<UTC>),
841 False,
842 True,
843 False,
844 False,
845 'nooookie@example.io',
846 'TALENT',
847 UUID('c89869a7-5909-49b6-9caf-ae75447c4769'))
848self
849<django.db.backends.utils.CursorDebugWrapper object at 0x7f1ecc16db38>
850sql
851('INSERT INTO "accounts_user" ("password", "last_login", "is_superuser", '
852 '"created_at", "updated_at", "is_staff", "is_active", "is_email_verified", '
853 '"is_account_verified", "email", "role", "jwt_secret") VALUES (%s, %s, %s, '
854 '%s, %s, %s, %s, %s, %s, %s, %s, %s) RETURNING "accounts_user"."id"')
855/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py in _execute
856 def _execute(self, sql, params, *ignored_wrapper_args):
857 self.db.validate_no_broken_transaction()
858 with self.db.wrap_database_errors:
859 if params is None:
860 return self.cursor.execute(sql)
861 else:
862 return self.cursor.execute(sql, params) …
863 def _executemany(self, sql, param_list, *ignored_wrapper_args):
864 self.db.validate_no_broken_transaction()
865 with self.db.wrap_database_errors:
866 return self.cursor.executemany(sql, param_list)
867▶ Local vars
868Variable Value
869ignored_wrapper_args
870(False,
871 {'connection': <django.db.backends.postgresql.base.DatabaseWrapper object at 0x7f1eced33cf8>,
872 'cursor': <django.db.backends.utils.CursorDebugWrapper object at 0x7f1ecc16db38>})
873params
874('pbkdf2_sha256$150000$jqhEPM57Kjt4$f5C44qAQ3WUxkElwWrm6tf7BBkP2Ub0507gzQPSVTA8=',
875 None,
876 False,
877 datetime.datetime(2019, 7, 1, 14, 12, 14, 262404, tzinfo=<UTC>),
878 datetime.datetime(2019, 7, 1, 14, 12, 14, 418081, tzinfo=<UTC>),
879 False,
880 True,
881 False,
882 False,
883 'nooookie@example.io',
884 'TALENT',
885 UUID('c89869a7-5909-49b6-9caf-ae75447c4769'))
886self
887<django.db.backends.utils.CursorDebugWrapper object at 0x7f1ecc16db38>
888sql
889('INSERT INTO "accounts_user" ("password", "last_login", "is_superuser", '
890 '"created_at", "updated_at", "is_staff", "is_active", "is_email_verified", '
891 '"is_account_verified", "email", "role", "jwt_secret") VALUES (%s, %s, %s, '
892 '%s, %s, %s, %s, %s, %s, %s, %s, %s) RETURNING "accounts_user"."id"')
893/usr/local/lib/python3.7/site-packages/django/db/utils.py in __exit__
894 db_exc_type = getattr(self.wrapper.Database, dj_exc_type.__name__)
895 if issubclass(exc_type, db_exc_type):
896 dj_exc_value = dj_exc_type(*exc_value.args)
897 # Only set the 'errors_occurred' flag for errors that may make
898 # the connection unusable.
899 if dj_exc_type not in (DataError, IntegrityError):
900 self.wrapper.errors_occurred = True
901 raise dj_exc_value.with_traceback(traceback) from exc_value …
902 def __call__(self, func):
903 # Note that we are intentionally not using @wraps here for performance
904 # reasons. Refs #21109.
905 def inner(*args, **kwargs):
906 with self:
907▶ Local vars
908Variable Value
909db_exc_type
910<class 'psycopg2.IntegrityError'>
911dj_exc_type
912<class 'django.db.utils.IntegrityError'>
913dj_exc_value
914IntegrityError('null value in column "is_available" violates not-null constraint\nDETAIL: Failing row contains (114, pbkdf2_sha256$150000$jqhEPM57Kjt4$f5C44qAQ3WUxkElwWrm6tf7BBkP2Ub..., null, f, 2019-07-01 14:12:14.262404+00, 2019-07-01 14:12:14.418081+00, f, t, f, f, nooookie@example.io, null, null, TALENT, null, null, c89869a7-5909-49b6-9caf-ae75447c4769, null, null, null, null).\n')
915exc_type
916<class 'psycopg2.errors.NotNullViolation'>
917exc_value
918NotNullViolation('null value in column "is_available" violates not-null constraint\nDETAIL: Failing row contains (114, pbkdf2_sha256$150000$jqhEPM57Kjt4$f5C44qAQ3WUxkElwWrm6tf7BBkP2Ub..., null, f, 2019-07-01 14:12:14.262404+00, 2019-07-01 14:12:14.418081+00, f, t, f, f, nooookie@example.io, null, null, TALENT, null, null, c89869a7-5909-49b6-9caf-ae75447c4769, null, null, null, null).\n')
919self
920<django.db.utils.DatabaseErrorWrapper object at 0x7f1eccb8d710>
921traceback
922<traceback object at 0x7f1ecc16e4c8>
923/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py in _execute
924 def _execute(self, sql, params, *ignored_wrapper_args):
925 self.db.validate_no_broken_transaction()
926 with self.db.wrap_database_errors:
927 if params is None:
928 return self.cursor.execute(sql)
929 else:
930 return self.cursor.execute(sql, params) …
931 def _executemany(self, sql, param_list, *ignored_wrapper_args):
932 self.db.validate_no_broken_transaction()
933 with self.db.wrap_database_errors:
934 return self.cursor.executemany(sql, param_list)
935▶ Local vars
936Variable Value
937ignored_wrapper_args
938(False,
939 {'connection': <django.db.backends.postgresql.base.DatabaseWrapper object at 0x7f1eced33cf8>,
940 'cursor': <django.db.backends.utils.CursorDebugWrapper object at 0x7f1ecc16db38>})
941params
942('pbkdf2_sha256$150000$jqhEPM57Kjt4$f5C44qAQ3WUxkElwWrm6tf7BBkP2Ub0507gzQPSVTA8=',
943 None,
944 False,
945 datetime.datetime(2019, 7, 1, 14, 12, 14, 262404, tzinfo=<UTC>),
946 datetime.datetime(2019, 7, 1, 14, 12, 14, 418081, tzinfo=<UTC>),
947 False,
948 True,
949 False,
950 False,
951 'nooookie@example.io',
952 'TALENT',
953 UUID('c89869a7-5909-49b6-9caf-ae75447c4769'))
954self
955<django.db.backends.utils.CursorDebugWrapper object at 0x7f1ecc16db38>
956sql
957('INSERT INTO "accounts_user" ("password", "last_login", "is_superuser", '
958 '"created_at", "updated_at", "is_staff", "is_active", "is_email_verified", '
959 '"is_account_verified", "email", "role", "jwt_secret") VALUES (%s, %s, %s, '
960 '%s, %s, %s, %s, %s, %s, %s, %s, %s) RETURNING "accounts_user"."id"')
961Environment:
962
963
964Request Method: POST
965Request URL: http://nookie1-staging.herokuapp.com/api/v1/accounts/register
966
967Django Version: 2.2.1
968Python Version: 3.7.3
969Installed Applications:
970['admin_interface',
971 'colorfield',
972 'django.contrib.admin',
973 'django.contrib.auth',
974 'django.contrib.contenttypes',
975 'django.contrib.sessions',
976 'django.contrib.messages',
977 'django.contrib.staticfiles',
978 'accounts.apps.AccountsConfig',
979 'misc.apps.MiscConfig',
980 'drf_yasg',
981 'rest_framework',
982 'corsheaders',
983 'storages',
984 'django_elasticsearch_dsl',
985 'django_elasticsearch_dsl_drf']
986Installed Middleware:
987['corsheaders.middleware.CorsMiddleware',
988 'django.middleware.common.CommonMiddleware',
989 'django.middleware.security.SecurityMiddleware',
990 'django.contrib.sessions.middleware.SessionMiddleware',
991 'django.middleware.locale.LocaleMiddleware',
992 'django.middleware.common.CommonMiddleware',
993 'django.middleware.csrf.CsrfViewMiddleware',
994 'django.contrib.auth.middleware.AuthenticationMiddleware',
995 'django.contrib.messages.middleware.MessageMiddleware',
996 'django.middleware.clickjacking.XFrameOptionsMiddleware',
997 'core.middleware.QueryCountDebugMiddleware']
998
999
1000
1001Traceback:
1002
1003File "/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py" in _execute
1004 84. return self.cursor.execute(sql, params)
1005
1006The above exception (null value in column "is_available" violates not-null constraint
1007DETAIL: Failing row contains (114, pbkdf2_sha256$150000$jqhEPM57Kjt4$f5C44qAQ3WUxkElwWrm6tf7BBkP2Ub..., null, f, 2019-07-01 14:12:14.262404+00, 2019-07-01 14:12:14.418081+00, f, t, f, f, nooookie@example.io, null, null, TALENT, null, null, c89869a7-5909-49b6-9caf-ae75447c4769, null, null, null, null).
1008) was the direct cause of the following exception:
1009
1010File "/usr/local/lib/python3.7/site-packages/django/core/handlers/exception.py" in inner
1011 34. response = get_response(request)
1012
1013File "/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
1014 115. response = self.process_exception_by_middleware(e, request)
1015
1016File "/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
1017 113. response = wrapped_callback(request, *callback_args, **callback_kwargs)
1018
1019File "/usr/local/lib/python3.7/site-packages/django/views/decorators/csrf.py" in wrapped_view
1020 54. return view_func(*args, **kwargs)
1021
1022File "/usr/local/lib/python3.7/site-packages/django/views/generic/base.py" in view
1023 71. return self.dispatch(request, *args, **kwargs)
1024
1025File "/usr/local/lib/python3.7/site-packages/rest_framework/views.py" in dispatch
1026 495. response = self.handle_exception(exc)
1027
1028File "/usr/local/lib/python3.7/site-packages/rest_framework/views.py" in handle_exception
1029 452. response = exception_handler(exc, context)
1030
1031File "/code/src/core/exceptions.py" in custom_exception_handler
1032 59. raise exc
1033
1034File "/usr/local/lib/python3.7/site-packages/rest_framework/views.py" in dispatch
1035 492. response = handler(request, *args, **kwargs)
1036
1037File "/code/src/accounts/views.py" in post
1038 95. user = serializer.save()
1039
1040File "/usr/local/lib/python3.7/site-packages/rest_framework/serializers.py" in save
1041 214. self.instance = self.create(validated_data)
1042
1043File "/code/src/accounts/serializers.py" in create
1044 120. user = User.objects.create_user(**validated_data)
1045
1046File "/code/src/accounts/models.py" in create_user
1047 42. return self._create_user(email, password, **kwargs)
1048
1049File "/code/src/accounts/models.py" in _create_user
1050 33. user.save(using=self._db)
1051
1052File "/usr/local/lib/python3.7/site-packages/django/contrib/auth/base_user.py" in save
1053 66. super().save(*args, **kwargs)
1054
1055File "/usr/local/lib/python3.7/site-packages/django/db/models/base.py" in save
1056 741. force_update=force_update, update_fields=update_fields)
1057
1058File "/usr/local/lib/python3.7/site-packages/django/db/models/base.py" in save_base
1059 779. force_update, using, update_fields,
1060
1061File "/usr/local/lib/python3.7/site-packages/django/db/models/base.py" in _save_table
1062 870. result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
1063
1064File "/usr/local/lib/python3.7/site-packages/django/db/models/base.py" in _do_insert
1065 908. using=using, raw=raw)
1066
1067File "/usr/local/lib/python3.7/site-packages/django/db/models/manager.py" in manager_method
1068 82. return getattr(self.get_queryset(), name)(*args, **kwargs)
1069
1070File "/usr/local/lib/python3.7/site-packages/django/db/models/query.py" in _insert
1071 1186. return query.get_compiler(using=using).execute_sql(return_id)
1072
1073File "/usr/local/lib/python3.7/site-packages/django/db/models/sql/compiler.py" in execute_sql
1074 1335. cursor.execute(sql, params)
1075
1076File "/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py" in execute
1077 99. return super().execute(sql, params)
1078
1079File "/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py" in execute
1080 67. return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
1081
1082File "/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py" in _execute_with_wrappers
1083 76. return executor(sql, params, many, context)
1084
1085File "/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py" in _execute
1086 84. return self.cursor.execute(sql, params)
1087
1088File "/usr/local/lib/python3.7/site-packages/django/db/utils.py" in __exit__
1089 89. raise dj_exc_value.with_traceback(traceback) from exc_value
1090
1091File "/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py" in _execute
1092 84. return self.cursor.execute(sql, params)
1093
1094Exception Type: IntegrityError at /api/v1/accounts/register
1095Exception Value: null value in column "is_available" violates not-null constraint
1096DETAIL: Failing row contains (114, pbkdf2_sha256$150000$jqhEPM57Kjt4$f5C44qAQ3WUxkElwWrm6tf7BBkP2Ub..., null, f, 2019-07-01 14:12:14.262404+00, 2019-07-01 14:12:14.418081+00, f, t, f, f, nooookie@example.io, null, null, TALENT, null, null, c89869a7-5909-49b6-9caf-ae75447c4769, null, null, null, null).
1097
1098
1099
1100
1101Request information
1102USER
1103AnonymousUser
1104
1105GET
1106No GET data
1107
1108POST
1109No POST data
1110
1111FILES
1112No FILES data
1113
1114COOKIES
1115No cookie data
1116
1117META
1118Variable Value
1119CONTENT_LENGTH
1120'71'
1121CONTENT_TYPE
1122'application/json'
1123HTTP_ACCEPT
1124'*/*'
1125HTTP_ACCEPT_ENCODING
1126'gzip, deflate, br'
1127HTTP_ACCEPT_LANGUAGE
1128'en-GB,en-US;q=0.9,en;q=0.8'
1129HTTP_CONNECTION
1130'close'
1131HTTP_CONNECT_TIME
1132'0'
1133HTTP_HOST
1134'nookie1-staging.herokuapp.com'
1135HTTP_ORIGIN
1136'http://localhost:3333'
1137HTTP_REFERER
1138'http://localhost:3333/signup'
1139HTTP_TOTAL_ROUTE_TIME
1140'0'
1141HTTP_USER_AGENT
1142('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, '
1143 'like Gecko) Chrome/75.0.3750.0 Safari/537.36')
1144HTTP_VIA
1145'1.1 vegur'
1146HTTP_X_FORWARDED_FOR
1147'37.30.26.218'
1148HTTP_X_FORWARDED_PORT
1149'443'
1150HTTP_X_FORWARDED_PROTO
1151'https'
1152HTTP_X_REQUEST_ID
1153'a9a90fad-59ce-4d2b-95ef-4ecf1065f469'
1154HTTP_X_REQUEST_START
1155'1561990334254'
1156PATH_INFO
1157'/api/v1/accounts/register'
1158QUERY_STRING
1159''
1160RAW_URI
1161'/api/v1/accounts/register'
1162REMOTE_ADDR
1163'10.14.49.90'
1164REMOTE_PORT
1165'11282'
1166REQUEST_METHOD
1167'POST'
1168SCRIPT_NAME
1169''
1170SERVER_NAME
1171'0.0.0.0'
1172SERVER_PORT
1173'52743'
1174SERVER_PROTOCOL
1175'HTTP/1.1'
1176SERVER_SOFTWARE
1177'gunicorn/19.9.0'
1178gunicorn.socket
1179<socket.socket fd=10, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('172.17.245.134', 52743), raddr=('10.14.49.90', 11282)>
1180wsgi.errors
1181<gunicorn.http.wsgi.WSGIErrorsWrapper object at 0x7f1ecc2704a8>
1182wsgi.file_wrapper
1183''
1184wsgi.input
1185<gunicorn.http.body.Body object at 0x7f1ecc270828>
1186wsgi.multiprocess
1187False
1188wsgi.multithread
1189False
1190wsgi.run_once
1191False
1192wsgi.url_scheme
1193'http'
1194wsgi.version
1195(1, 0)
1196Settings
1197Using settings module config.settings.staging
1198Setting Value
1199ABSOLUTE_URL_OVERRIDES
1200{}
1201ADMINS
1202[]
1203ALLOWED_HOSTS
1204['*']
1205APPEND_SLASH
1206True
1207AUTHENTICATION_BACKENDS
1208['django.contrib.auth.backends.ModelBackend']
1209AUTH_PASSWORD_VALIDATORS
1210'********************'
1211AUTH_USER_MODEL
1212'accounts.User'
1213AWS_ACCESS_KEY_ID
1214'********************'
1215AWS_QUERYSTRING_AUTH
1216False
1217AWS_S3_CUSTOM_DOMAIN
1218'stcdn.nookie1.com'
1219AWS_SECRET_ACCESS_KEY
1220'********************'
1221AWS_STORAGE_BUCKET_NAME
1222'stcdn.nookie1.com'
1223BASE_DIR
1224'/code/src/config'
1225CACHES
1226{'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}}
1227CACHE_MIDDLEWARE_ALIAS
1228'default'
1229CACHE_MIDDLEWARE_KEY_PREFIX
1230'********************'
1231CACHE_MIDDLEWARE_SECONDS
1232600
1233CORS_ORIGIN_ALLOW_ALL
1234True
1235CSRF_COOKIE_AGE
123631449600
1237CSRF_COOKIE_DOMAIN
1238None
1239CSRF_COOKIE_HTTPONLY
1240False
1241CSRF_COOKIE_NAME
1242'csrftoken'
1243CSRF_COOKIE_PATH
1244'/'
1245CSRF_COOKIE_SAMESITE
1246'Lax'
1247CSRF_COOKIE_SECURE
1248False
1249CSRF_FAILURE_VIEW
1250'django.views.csrf.csrf_failure'
1251CSRF_HEADER_NAME
1252'HTTP_X_CSRFTOKEN'
1253CSRF_TRUSTED_ORIGINS
1254[]
1255CSRF_USE_SESSIONS
1256False
1257DATABASES
1258{'default': {'ATOMIC_REQUESTS': False,
1259 'AUTOCOMMIT': True,
1260 'CONN_MAX_AGE': 600,
1261 'ENGINE': 'django.db.backends.postgresql_psycopg2',
1262 'HOST': 'ec2-79-125-4-72.eu-west-1.compute.amazonaws.com',
1263 'NAME': 'dvc8e6of3rjvr',
1264 'OPTIONS': {'sslmode': 'require'},
1265 'PASSWORD': '********************',
1266 'PORT': 5432,
1267 'TEST': {'CHARSET': None,
1268 'COLLATION': None,
1269 'MIRROR': None,
1270 'NAME': None},
1271 'TIME_ZONE': None,
1272 'USER': 'zfkemnmbwrxgfk'}}
1273DATABASE_ROUTERS
1274[]
1275DATA_UPLOAD_MAX_MEMORY_SIZE
12762621440
1277DATA_UPLOAD_MAX_NUMBER_FIELDS
12781000
1279DATETIME_FORMAT
1280'N j, Y, P'
1281DATETIME_INPUT_FORMATS
1282['%Y-%m-%d %H:%M:%S',
1283 '%Y-%m-%d %H:%M:%S.%f',
1284 '%Y-%m-%d %H:%M',
1285 '%Y-%m-%d',
1286 '%m/%d/%Y %H:%M:%S',
1287 '%m/%d/%Y %H:%M:%S.%f',
1288 '%m/%d/%Y %H:%M',
1289 '%m/%d/%Y',
1290 '%m/%d/%y %H:%M:%S',
1291 '%m/%d/%y %H:%M:%S.%f',
1292 '%m/%d/%y %H:%M',
1293 '%m/%d/%y']
1294DATE_FORMAT
1295'N j, Y'
1296DATE_INPUT_FORMATS
1297['%Y-%m-%d',
1298 '%m/%d/%Y',
1299 '%m/%d/%y',
1300 '%b %d %Y',
1301 '%b %d, %Y',
1302 '%d %b %Y',
1303 '%d %b, %Y',
1304 '%B %d %Y',
1305 '%B %d, %Y',
1306 '%d %B %Y',
1307 '%d %B, %Y']
1308DEBUG
1309True
1310DEBUG_PROPAGATE_EXCEPTIONS
1311False
1312DECIMAL_SEPARATOR
1313'.'
1314DEFAULT_CHARSET
1315'utf-8'
1316DEFAULT_CONTENT_TYPE
1317'text/html'
1318DEFAULT_EXCEPTION_REPORTER_FILTER
1319'django.views.debug.SafeExceptionReporterFilter'
1320DEFAULT_FILE_STORAGE
1321'storages.backends.s3boto3.S3Boto3Storage'
1322DEFAULT_FROM_EMAIL
1323'noreply@nookie1.com'
1324DEFAULT_INDEX_TABLESPACE
1325''
1326DEFAULT_TABLESPACE
1327''
1328DISALLOWED_USER_AGENTS
1329[]
1330ELASTICSEARCH_DSL
1331{'default': {'hosts': 'https://coc3k37eg3:fvfxspnb3u@yew-398680777.eu-west-1.bonsaisearch.net:443'}}
1332EMAIL_BACKEND
1333'sparkpost.django.email_backend.SparkPostEmailBackend'
1334EMAIL_HOST
1335'localhost'
1336EMAIL_HOST_PASSWORD
1337'********************'
1338EMAIL_HOST_USER
1339''
1340EMAIL_PORT
134125
1342EMAIL_SSL_CERTFILE
1343None
1344EMAIL_SSL_KEYFILE
1345'********************'
1346EMAIL_SUBJECT_PREFIX
1347'[Django] '
1348EMAIL_TIMEOUT
1349None
1350EMAIL_USE_LOCALTIME
1351False
1352EMAIL_USE_SSL
1353False
1354EMAIL_USE_TLS
1355False
1356FILE_CHARSET
1357'utf-8'
1358FILE_UPLOAD_DIRECTORY_PERMISSIONS
1359None
1360FILE_UPLOAD_HANDLERS
1361['django.core.files.uploadhandler.MemoryFileUploadHandler',
1362 'django.core.files.uploadhandler.TemporaryFileUploadHandler']
1363FILE_UPLOAD_MAX_MEMORY_SIZE
13642621440
1365FILE_UPLOAD_PERMISSIONS
1366None
1367FILE_UPLOAD_TEMP_DIR
1368None
1369FIRST_DAY_OF_WEEK
13700
1371FIXTURE_DIRS
1372[]
1373FORCE_SCRIPT_NAME
1374None
1375FORMAT_MODULE_PATH
1376None
1377FORM_RENDERER
1378'django.forms.renderers.DjangoTemplates'
1379FROM_EMAIL
1380'no-reply@nookie1.com'
1381FRONT_HOSTNAME
1382'https://nookie1.com/'
1383IGNORABLE_404_URLS
1384[]
1385INSTALLED_APPS
1386['admin_interface',
1387 'colorfield',
1388 'django.contrib.admin',
1389 'django.contrib.auth',
1390 'django.contrib.contenttypes',
1391 'django.contrib.sessions',
1392 'django.contrib.messages',
1393 'django.contrib.staticfiles',
1394 'accounts.apps.AccountsConfig',
1395 'misc.apps.MiscConfig',
1396 'drf_yasg',
1397 'rest_framework',
1398 'corsheaders',
1399 'storages',
1400 'django_elasticsearch_dsl',
1401 'django_elasticsearch_dsl_drf']
1402INTERNAL_IPS
1403[]
1404JWT_AUTH
1405{'JWT_AUTH_HEADER_PREFIX': 'Bearer'}
1406LANGUAGES
1407[('af', 'Afrikaans'),
1408 ('ar', 'Arabic'),
1409 ('ast', 'Asturian'),
1410 ('az', 'Azerbaijani'),
1411 ('bg', 'Bulgarian'),
1412 ('be', 'Belarusian'),
1413 ('bn', 'Bengali'),
1414 ('br', 'Breton'),
1415 ('bs', 'Bosnian'),
1416 ('ca', 'Catalan'),
1417 ('cs', 'Czech'),
1418 ('cy', 'Welsh'),
1419 ('da', 'Danish'),
1420 ('de', 'German'),
1421 ('dsb', 'Lower Sorbian'),
1422 ('el', 'Greek'),
1423 ('en', 'English'),
1424 ('en-au', 'Australian English'),
1425 ('en-gb', 'British English'),
1426 ('eo', 'Esperanto'),
1427 ('es', 'Spanish'),
1428 ('es-ar', 'Argentinian Spanish'),
1429 ('es-co', 'Colombian Spanish'),
1430 ('es-mx', 'Mexican Spanish'),
1431 ('es-ni', 'Nicaraguan Spanish'),
1432 ('es-ve', 'Venezuelan Spanish'),
1433 ('et', 'Estonian'),
1434 ('eu', 'Basque'),
1435 ('fa', 'Persian'),
1436 ('fi', 'Finnish'),
1437 ('fr', 'French'),
1438 ('fy', 'Frisian'),
1439 ('ga', 'Irish'),
1440 ('gd', 'Scottish Gaelic'),
1441 ('gl', 'Galician'),
1442 ('he', 'Hebrew'),
1443 ('hi', 'Hindi'),
1444 ('hr', 'Croatian'),
1445 ('hsb', 'Upper Sorbian'),
1446 ('hu', 'Hungarian'),
1447 ('hy', 'Armenian'),
1448 ('ia', 'Interlingua'),
1449 ('id', 'Indonesian'),
1450 ('io', 'Ido'),
1451 ('is', 'Icelandic'),
1452 ('it', 'Italian'),
1453 ('ja', 'Japanese'),
1454 ('ka', 'Georgian'),
1455 ('kab', 'Kabyle'),
1456 ('kk', 'Kazakh'),
1457 ('km', 'Khmer'),
1458 ('kn', 'Kannada'),
1459 ('ko', 'Korean'),
1460 ('lb', 'Luxembourgish'),
1461 ('lt', 'Lithuanian'),
1462 ('lv', 'Latvian'),
1463 ('mk', 'Macedonian'),
1464 ('ml', 'Malayalam'),
1465 ('mn', 'Mongolian'),
1466 ('mr', 'Marathi'),
1467 ('my', 'Burmese'),
1468 ('nb', 'Norwegian Bokmål'),
1469 ('ne', 'Nepali'),
1470 ('nl', 'Dutch'),
1471 ('nn', 'Norwegian Nynorsk'),
1472 ('os', 'Ossetic'),
1473 ('pa', 'Punjabi'),
1474 ('pl', 'Polish'),
1475 ('pt', 'Portuguese'),
1476 ('pt-br', 'Brazilian Portuguese'),
1477 ('ro', 'Romanian'),
1478 ('ru', 'Russian'),
1479 ('sk', 'Slovak'),
1480 ('sl', 'Slovenian'),
1481 ('sq', 'Albanian'),
1482 ('sr', 'Serbian'),
1483 ('sr-latn', 'Serbian Latin'),
1484 ('sv', 'Swedish'),
1485 ('sw', 'Swahili'),
1486 ('ta', 'Tamil'),
1487 ('te', 'Telugu'),
1488 ('th', 'Thai'),
1489 ('tr', 'Turkish'),
1490 ('tt', 'Tatar'),
1491 ('udm', 'Udmurt'),
1492 ('uk', 'Ukrainian'),
1493 ('ur', 'Urdu'),
1494 ('vi', 'Vietnamese'),
1495 ('zh-hans', 'Simplified Chinese'),
1496 ('zh-hant', 'Traditional Chinese')]
1497LANGUAGES_BIDI
1498['he', 'ar', 'fa', 'ur']
1499LANGUAGE_CODE
1500'en-us'
1501LANGUAGE_COOKIE_AGE
1502None
1503LANGUAGE_COOKIE_DOMAIN
1504None
1505LANGUAGE_COOKIE_NAME
1506'django_language'
1507LANGUAGE_COOKIE_PATH
1508'/'
1509LOCALE_PATHS
1510('/code/src/config/locale',)
1511LOGGING
1512{'disable_existing_loggers': False,
1513 'handlers': {'console': {'class': 'logging.StreamHandler'}},
1514 'loggers': {},
1515 'version': 1}
1516LOGGING_CONFIG
1517'logging.config.dictConfig'
1518LOGIN_REDIRECT_URL
1519'/accounts/profile/'
1520LOGIN_URL
1521'/accounts/login/'
1522LOGOUT_REDIRECT_URL
1523None
1524MANAGERS
1525[]
1526MEDIA_ROOT
1527'/code/src/config/media'
1528MEDIA_URL
1529'stcdn.nookie1.com/media/'
1530MESSAGE_STORAGE
1531'django.contrib.messages.storage.fallback.FallbackStorage'
1532MIDDLEWARE
1533['corsheaders.middleware.CorsMiddleware',
1534 'django.middleware.common.CommonMiddleware',
1535 'django.middleware.security.SecurityMiddleware',
1536 'django.contrib.sessions.middleware.SessionMiddleware',
1537 'django.middleware.locale.LocaleMiddleware',
1538 'django.middleware.common.CommonMiddleware',
1539 'django.middleware.csrf.CsrfViewMiddleware',
1540 'django.contrib.auth.middleware.AuthenticationMiddleware',
1541 'django.contrib.messages.middleware.MessageMiddleware',
1542 'django.middleware.clickjacking.XFrameOptionsMiddleware',
1543 'core.middleware.QueryCountDebugMiddleware']
1544MIGRATION_MODULES
1545{}
1546MONTH_DAY_FORMAT
1547'F j'
1548NUMBER_GROUPING
15490
1550PASSWORD_HASHERS
1551'********************'
1552PASSWORD_RESET_TIMEOUT_DAYS
1553'********************'
1554PREPEND_WWW
1555False
1556REST_FRAMEWORK
1557{'DEFAULT_AUTHENTICATION_CLASSES': ('core.authentication.MyJWTAuthentication',),
1558 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
1559 'DEFAULT_PERMISSION_CLASSES': ('rest_framework.permissions.IsAuthenticated',),
1560 'EXCEPTION_HANDLER': 'core.exceptions.custom_exception_handler',
1561 'ORDERING_PARAM': 'ordering',
1562 'PAGE_SIZE': 10}
1563ROOT_URLCONF
1564'config.urls'
1565SECRET_KEY
1566'********************'
1567SECURE_BROWSER_XSS_FILTER
1568False
1569SECURE_CONTENT_TYPE_NOSNIFF
1570False
1571SECURE_HSTS_INCLUDE_SUBDOMAINS
1572False
1573SECURE_HSTS_PRELOAD
1574False
1575SECURE_HSTS_SECONDS
15760
1577SECURE_PROXY_SSL_HEADER
1578None
1579SECURE_REDIRECT_EXEMPT
1580[]
1581SECURE_SSL_HOST
1582None
1583SECURE_SSL_REDIRECT
1584False
1585SERVER_EMAIL
1586'root@localhost'
1587SESSION_CACHE_ALIAS
1588'default'
1589SESSION_COOKIE_AGE
15901209600
1591SESSION_COOKIE_DOMAIN
1592None
1593SESSION_COOKIE_HTTPONLY
1594True
1595SESSION_COOKIE_NAME
1596'sessionid'
1597SESSION_COOKIE_PATH
1598'/'
1599SESSION_COOKIE_SAMESITE
1600'Lax'
1601SESSION_COOKIE_SECURE
1602False
1603SESSION_ENGINE
1604'django.contrib.sessions.backends.db'
1605SESSION_EXPIRE_AT_BROWSER_CLOSE
1606False
1607SESSION_FILE_PATH
1608None
1609SESSION_SAVE_EVERY_REQUEST
1610False
1611SESSION_SERIALIZER
1612'django.contrib.sessions.serializers.JSONSerializer'
1613SETTINGS_MODULE
1614'config.settings.staging'
1615SHORT_DATETIME_FORMAT
1616'm/d/Y P'
1617SHORT_DATE_FORMAT
1618'm/d/Y'
1619SIGNING_BACKEND
1620'django.core.signing.TimestampSigner'
1621SILENCED_SYSTEM_CHECKS
1622[]
1623SIMPLE_JWT
1624{'ACCESS_TOKEN_LIFETIME': '********************',
1625 'REFRESH_TOKEN_LIFETIME': '********************',
1626 'ROTATE_REFRESH_TOKENS': '********************',
1627 'USER_ID_FIELD': 'jwt_secret'}
1628SPARKPOST_API_KEY
1629'********************'
1630STATICFILES_DIRS
1631('/code/src/config/static',)
1632STATICFILES_FINDERS
1633['django.contrib.staticfiles.finders.FileSystemFinder',
1634 'django.contrib.staticfiles.finders.AppDirectoriesFinder']
1635STATICFILES_STORAGE
1636'storages.backends.s3boto3.S3Boto3Storage'
1637STATIC_ROOT
1638None
1639STATIC_URL
1640'stcdn.nookie1.com/static/'
1641SWAGGER_SETTINGS
1642{'DISPLAY_OPERATION_ID': False,
1643 'OPERATIONS_SORTER': 'method',
1644 'SECURITY_DEFINITIONS': None,
1645 'USE_SESSION_AUTH': False}
1646TEMPLATES
1647[{'APP_DIRS': True,
1648 'BACKEND': 'django.template.backends.django.DjangoTemplates',
1649 'DIRS': ['/code/src/config/templates'],
1650 'OPTIONS': {'context_processors': ['django.template.context_processors.debug',
1651 'django.template.context_processors.request',
1652 'django.contrib.auth.context_processors.auth',
1653 'django.contrib.messages.context_processors.messages']}}]
1654TEST_NON_SERIALIZED_APPS
1655[]
1656TEST_RUNNER
1657'django.test.runner.DiscoverRunner'
1658THOUSAND_SEPARATOR
1659','
1660TIME_FORMAT
1661'P'
1662TIME_INPUT_FORMATS
1663['%H:%M:%S', '%H:%M:%S.%f', '%H:%M']
1664TIME_ZONE
1665'UTC'
1666TOKEN_LIFETIME
1667'********************'
1668USE_I18N
1669True
1670USE_L10N
1671True
1672USE_THOUSAND_SEPARATOR
1673False
1674USE_TZ
1675True
1676USE_X_FORWARDED_HOST
1677False
1678USE_X_FORWARDED_PORT
1679False
1680WSGI_APPLICATION
1681'config.wsgi.application'
1682X_FRAME_OPTIONS
1683'SAMEORIGIN'
1684YEAR_MONTH_FORMAT
1685'F Y'
1686You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard page generated by the handler for this status code.