이경수

chart modified

Showing 989 changed files with 27 additions and 13 deletions
...@@ -4,16 +4,16 @@ from django import forms ...@@ -4,16 +4,16 @@ from django import forms
4 from django.contrib.auth.models import User 4 from django.contrib.auth.models import User
5 5
6 class UserCreationForm(UserCreationForm): 6 class UserCreationForm(UserCreationForm):
7 - email = EmailField(label=("이메일"), required=True, 7 + email = EmailField(label=("이메일"), required=False,
8 help_text=("이메일을 등록하세요.")) 8 help_text=("이메일을 등록하세요."))
9 9
10 - repository = URLField(label=("레포지토리"), required=True, 10 + # repository = URLField(label=("레포지토리"), required=True,
11 - help_text=("github 레포지토리를 등록하세요.")) 11 + # help_text=("github 레포지토리를 등록하세요."))
12 - 12 + #
13 13
14 class UserEditForm(forms.Form): 14 class UserEditForm(forms.Form):
15 - email = EmailField(label=("이메일"), required=True, 15 + # email = EmailField(label=("이메일"), required=True,
16 - help_text=("이메일을 입력하세요.")) 16 + # help_text=("이메일을 입력하세요."))
17 17
18 repository = URLField(label=("레포지토리"), required=True, 18 repository = URLField(label=("레포지토리"), required=True,
19 help_text=("github 레포지토리를 입력하세요.")) 19 help_text=("github 레포지토리를 입력하세요."))
...@@ -21,11 +21,10 @@ class UserEditForm(forms.Form): ...@@ -21,11 +21,10 @@ class UserEditForm(forms.Form):
21 21
22 class Meta: 22 class Meta:
23 model = User 23 model = User
24 - fields = ("username", "email", "repository", "password1", "password2") 24 + fields = ("username", "repository", "password1", "password2")
25 25
26 def save(self, commit=True): 26 def save(self, commit=True):
27 user = super(UserCreationForm, self).save(commit=False) 27 user = super(UserCreationForm, self).save(commit=False)
28 - user.email = self.cleaned_data["email"]
29 user.repository = self.cleaned_data["repository"] 28 user.repository = self.cleaned_data["repository"]
30 if commit: 29 if commit:
31 user.save() 30 user.save()
......
...@@ -88,9 +88,9 @@ DATABASES = { ...@@ -88,9 +88,9 @@ DATABASES = {
88 'default': { 88 'default': {
89 'ENGINE': 'django.db.backends.mysql', 89 'ENGINE': 'django.db.backends.mysql',
90 'NAME': 'vuln', 90 'NAME': 'vuln',
91 - 'USER': 'yhackerbv', 91 + 'USER': 'ingjiyun',
92 - 'PASSWORD': 'guswhd12', 92 + 'PASSWORD': 'vulnnotti93',
93 - 'HOST': 'vulndb.cby38wfppa7l.us-east-2.rds.amazonaws.com', 93 + 'HOST': 'vulnnotti.cr0yrwhvisei.ap-northeast-2.rds.amazonaws.com',
94 'PORT': '3306' 94 'PORT': '3306'
95 } 95 }
96 } 96 }
......
...@@ -6,6 +6,7 @@ from django.contrib.auth.forms import UserCreationForm ...@@ -6,6 +6,7 @@ from django.contrib.auth.forms import UserCreationForm
6 from django.http import HttpResponseRedirect, HttpResponse 6 from django.http import HttpResponseRedirect, HttpResponse
7 from VulnNotti.forms import *; 7 from VulnNotti.forms import *;
8 from django.shortcuts import redirect, render 8 from django.shortcuts import redirect, render
9 +from django.db import connection
9 10
10 class HomeView(View): 11 class HomeView(View):
11 template_name = 'index.html' 12 template_name = 'index.html'
...@@ -72,10 +73,22 @@ class EditView(TemplateView): ...@@ -72,10 +73,22 @@ class EditView(TemplateView):
72 73
73 def post(self, request, *args, **kwargs): 74 def post(self, request, *args, **kwargs):
74 75
75 - email = self.request.POST['email']
76 repository = self.request.POST['repository'] 76 repository = self.request.POST['repository']
77 + user = request.user
78 +
79 +
80 + query = "UPDATE vuln.auth_user SET repository = %s WHERE username = %s"
81 +
82 + param_list = []
83 +
84 + param_list.append(str(repository))
85 + param_list.append(str(user))
77 86
78 - print(email, repository) 87 +
88 + with connection.cursor() as cursor:
89 + cursor.execute(query, param_list)
90 +
91 + print(repository, user)
79 return render(self.request, 'index.html') 92 return render(self.request, 'index.html')
80 93
81 94
...@@ -85,5 +98,7 @@ class UserCreateView(CreateView): ...@@ -85,5 +98,7 @@ class UserCreateView(CreateView):
85 success_url = reverse_lazy('register_done') 98 success_url = reverse_lazy('register_done')
86 form_class = UserCreationForm 99 form_class = UserCreationForm
87 100
101 +
102 +
88 class UserCreateDoneTV(TemplateView): 103 class UserCreateDoneTV(TemplateView):
89 template_name = 'registration/register_done.html' 104 template_name = 'registration/register_done.html'
......
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.