이경수

chart modified

Showing 989 changed files with 27 additions and 13 deletions
......@@ -4,16 +4,16 @@ from django import forms
from django.contrib.auth.models import User
class UserCreationForm(UserCreationForm):
email = EmailField(label=("이메일"), required=True,
email = EmailField(label=("이메일"), required=False,
help_text=("이메일을 등록하세요."))
repository = URLField(label=("레포지토리"), required=True,
help_text=("github 레포지토리를 등록하세요."))
# repository = URLField(label=("레포지토리"), required=True,
# help_text=("github 레포지토리를 등록하세요."))
#
class UserEditForm(forms.Form):
email = EmailField(label=("이메일"), required=True,
help_text=("이메일을 입력하세요."))
# email = EmailField(label=("이메일"), required=True,
# help_text=("이메일을 입력하세요."))
repository = URLField(label=("레포지토리"), required=True,
help_text=("github 레포지토리를 입력하세요."))
......@@ -21,11 +21,10 @@ class UserEditForm(forms.Form):
class Meta:
model = User
fields = ("username", "email", "repository", "password1", "password2")
fields = ("username", "repository", "password1", "password2")
def save(self, commit=True):
user = super(UserCreationForm, self).save(commit=False)
user.email = self.cleaned_data["email"]
user.repository = self.cleaned_data["repository"]
if commit:
user.save()
......
......@@ -88,9 +88,9 @@ DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'vuln',
'USER': 'yhackerbv',
'PASSWORD': 'guswhd12',
'HOST': 'vulndb.cby38wfppa7l.us-east-2.rds.amazonaws.com',
'USER': 'ingjiyun',
'PASSWORD': 'vulnnotti93',
'HOST': 'vulnnotti.cr0yrwhvisei.ap-northeast-2.rds.amazonaws.com',
'PORT': '3306'
}
}
......
......@@ -6,6 +6,7 @@ from django.contrib.auth.forms import UserCreationForm
from django.http import HttpResponseRedirect, HttpResponse
from VulnNotti.forms import *;
from django.shortcuts import redirect, render
from django.db import connection
class HomeView(View):
template_name = 'index.html'
......@@ -72,10 +73,22 @@ class EditView(TemplateView):
def post(self, request, *args, **kwargs):
email = self.request.POST['email']
repository = self.request.POST['repository']
user = request.user
query = "UPDATE vuln.auth_user SET repository = %s WHERE username = %s"
param_list = []
param_list.append(str(repository))
param_list.append(str(user))
print(email, repository)
with connection.cursor() as cursor:
cursor.execute(query, param_list)
print(repository, user)
return render(self.request, 'index.html')
......@@ -85,5 +98,7 @@ class UserCreateView(CreateView):
success_url = reverse_lazy('register_done')
form_class = UserCreationForm
class UserCreateDoneTV(TemplateView):
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.