add department/post to userprofile
This commit is contained in:
parent
43f392c73b
commit
c440f1f509
|
@ -17,16 +17,10 @@ from django.contrib import admin
|
||||||
from django.urls import path, re_path, include
|
from django.urls import path, re_path, include
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.conf.urls.static import static
|
from django.conf.urls.static import static
|
||||||
from wagtail.admin import urls as wagtailadmin_urls
|
|
||||||
from wagtail.documents import urls as wagtaildocs_urls
|
|
||||||
from wagtail.core import urls as wagtail_urls
|
|
||||||
|
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('polls/', include('polls.urls')),
|
path('polls/', include('polls.urls')),
|
||||||
re_path(r'^cms/', include(wagtailadmin_urls)),
|
|
||||||
re_path(r'^documents/', include(wagtaildocs_urls)),
|
|
||||||
re_path(r'^pages/', include(wagtail_urls)),
|
|
||||||
path('admin/', admin.site.urls),
|
path('admin/', admin.site.urls),
|
||||||
path('', include('dashboard.urls')),
|
path('', include('dashboard.urls')),
|
||||||
path('captcha/', include('captcha.urls')),
|
path('captcha/', include('captcha.urls')),
|
||||||
|
|
|
@ -108,6 +108,8 @@ class Userprofile(models.Model):
|
||||||
user = models.ForeignKey(User, on_delete=models.CASCADE)
|
user = models.ForeignKey(User, on_delete=models.CASCADE)
|
||||||
name = models.CharField('姓名', null=True, blank=True, max_length=256)
|
name = models.CharField('姓名', null=True, blank=True, max_length=256)
|
||||||
sex = models.CharField('性别', null=True, blank=True, max_length=256)
|
sex = models.CharField('性别', null=True, blank=True, max_length=256)
|
||||||
|
department = models.CharField('部门', null=True, blank=True, max_length=256)
|
||||||
|
post = models.CharField('职务', null=True, blank=True, max_length=256)
|
||||||
image = models.FileField(upload_to='profile', null=True, blank=True)
|
image = models.FileField(upload_to='profile', null=True, blank=True)
|
||||||
organization = models.ForeignKey(
|
organization = models.ForeignKey(
|
||||||
Organization, on_delete=models.CASCADE, null=True, blank=True)
|
Organization, on_delete=models.CASCADE, null=True, blank=True)
|
||||||
|
|
Binary file not shown.
|
@ -75,7 +75,7 @@ def send_code(request):
|
||||||
after_1min = now + datetime.timedelta(minutes=1)
|
after_1min = now + datetime.timedelta(minutes=1)
|
||||||
response = sent_sms_code(phone, code)
|
response = sent_sms_code(phone, code)
|
||||||
result = response.decode('utf8')
|
result = response.decode('utf8')
|
||||||
print(result)
|
print(phone,result)
|
||||||
if "OK" in result:
|
if "OK" in result:
|
||||||
VerifyCode.objects.create(
|
VerifyCode.objects.create(
|
||||||
code=code, phone=phone, category=category, timeouted=after_1min)
|
code=code, phone=phone, category=category, timeouted=after_1min)
|
||||||
|
|
Loading…
Reference in New Issue