add department/post to userprofile

This commit is contained in:
baoliang 2020-09-17 16:23:27 +08:00
parent 43f392c73b
commit c440f1f509
4 changed files with 3 additions and 7 deletions

View File

@ -17,16 +17,10 @@ from django.contrib import admin
from django.urls import path, re_path, include
from django.conf import settings
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 = [
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('', include('dashboard.urls')),
path('captcha/', include('captcha.urls')),

View File

@ -108,6 +108,8 @@ class Userprofile(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE)
name = 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)
organization = models.ForeignKey(
Organization, on_delete=models.CASCADE, null=True, blank=True)

View File

@ -75,7 +75,7 @@ def send_code(request):
after_1min = now + datetime.timedelta(minutes=1)
response = sent_sms_code(phone, code)
result = response.decode('utf8')
print(result)
print(phone,result)
if "OK" in result:
VerifyCode.objects.create(
code=code, phone=phone, category=category, timeouted=after_1min)