Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add user by admin console #931

Closed
kenneth-l-i opened this issue Mar 29, 2019 · 1 comment
Closed

Add user by admin console #931

kenneth-l-i opened this issue Mar 29, 2019 · 1 comment

Comments

@kenneth-l-i
Copy link
Contributor

I found that if I create a new user in the admin console (not by click "register" and filling form),
there will be a lot of "site: fatal signal: Segmentation fault" error.
`SIGSEGV: invalid_state
页面错误 /users/
site: fatal signal: Segmentation fault
site died (signal 500, exit -11)

panic: go back
Traceback (most recent call last):
File "/dmoj/dmojsite/local/lib/python2.7/site-packages/django/core/handlers/exception.py", line 41, in inner
response = get_response(request)
File "/dmoj/dmojsite/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 217, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/dmoj/dmojsite/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 215, in _get_response
response = response.render()
File "/dmoj/dmojsite/local/lib/python2.7/site-packages/django/template/response.py", line 107, in render
self.content = self.rendered_content
File "/dmoj/dmojsite/local/lib/python2.7/site-packages/django/template/response.py", line 84, in rendered_content
content = template.render(context, self._request)
File "/dmoj/dmojsite/local/lib/python2.7/site-packages/django_jinja/backend.py", line 106, in render
return mark_safe(self.template.render(context))
File "/dmoj/dmojsite/local/lib/python2.7/site-packages/jinja2/environment.py", line 1008, in render
return self.environment.handle_exception(exc_info, True)
File "/dmoj/dmojsite/local/lib/python2.7/site-packages/jinja2/environment.py", line 780, in handle_exception
reraise(exc_type, exc_value, tb)
File "/dmoj/site/templates/user/list.html", line 1, in top-level template code
{% extends "user/base-users.html" %}
File "/dmoj/site/templates/user/base-users.html", line 1, in top-level template code
{% extends "common-content.html" %}
File "/dmoj/site/templates/common-content.html", line 1, in top-level template code
{% extends "base.html" %}
File "/dmoj/site/templates/base.html", line 277, in top-level template code

{% block body %}{% endblock %}

File "/dmoj/site/templates/user/base-users.html", line 75, in block "body"
{% block users_table %}{% endblock %}
File "/dmoj/site/templates/user/list.html", line 25, in block "users_table"
{% include "user/users-table.html" %}
File "/dmoj/site/templates/user/users-table.html", line 1, in top-level template code
{% extends "user/base-users-table.html" %}
File "/dmoj/site/templates/user/base-users-table.html", line 23, in top-level template code
{{ link_user(user) }} - ({{ (user.user.first_name) }} {{ (user.user.last_name) }})
File "/dmoj/dmojsite/local/lib/python2.7/site-packages/django_jinja/library.py", line 92, in _wrapper
data = render_to_string(template, fn(*args, **kwargs))
File "/dmoj/dmojsite/local/lib/python2.7/site-packages/django/template/loader.py", line 68, in render_to_string
return template.render(context, request)
File "/dmoj/dmojsite/local/lib/python2.7/site-packages/django_jinja/backend.py", line 106, in render
return mark_safe(self.template.render(context))
File "/dmoj/dmojsite/local/lib/python2.7/site-packages/jinja2/environment.py", line 1008, in render
return self.environment.handle_exception(exc_info, True)
File "/dmoj/dmojsite/local/lib/python2.7/site-packages/jinja2/environment.py", line 780, in handle_exception
reraise(exc_type, exc_value, tb)
File "/dmoj/site/templates/user/link.html", line 1, in top-level template code
{{ user.username }}
File "/dmoj/dmojsite/local/lib/python2.7/site-packages/django_jinja/builtins/extensions.py", line 162, in _url_reverse
return reverse(name, args=args, kwargs=kwargs)
File "/dmoj/dmojsite/local/lib/python2.7/site-packages/django/urls/base.py", line 91, in reverse
return force_text(iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs)))
File "/dmoj/dmojsite/local/lib/python2.7/site-packages/django/urls/resolvers.py", line 497, in _reverse_with_prefix
raise NoReverseMatch(msg)
NoReverseMatch: Reverse for 'user_page' with arguments '(u'a_new_login_name',)' not found. 2 pattern(s) tried: ['user/(?P\w+)$', 'user$']`

@Xyene
Copy link
Member

Xyene commented Mar 29, 2019

Do not add users manually. Use manage.py adduser instead.

@Xyene Xyene closed this as completed Mar 29, 2019
Ninjaclasher added a commit to Ninjaclasher/site that referenced this issue Oct 11, 2023
- Automatically create profile when adding a user through admin
- Disallow adding profiles through admin
- (Soft) disallow deleting profiles through admin
Ninjaclasher added a commit to Ninjaclasher/site that referenced this issue Oct 28, 2023
- Automatically create profile when adding a user through admin
- Disallow adding profiles through admin
- (Soft) disallow deleting profiles through admin
github-merge-queue bot pushed a commit that referenced this issue Oct 28, 2023
- Automatically create profile when adding a user through admin
- Disallow adding profiles through admin
- (Soft) disallow deleting profiles through admin
hieplpvip pushed a commit to VNOI-Admin/OJ that referenced this issue Oct 30, 2023
…MOJ/online-judge#2288

- Automatically create profile when adding a user through admin
- Disallow adding profiles through admin
- (Soft) disallow deleting profiles through admin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants