Fakultas Ilmu Komputer UI

Commit 74ca6eef authored by Yaumi's avatar Yaumi
Browse files

[REFACTOR] for merge request

parent ae4df14a
Pipeline #58929 passed with stages
in 16 minutes and 27 seconds
......@@ -56,7 +56,7 @@ from .views import (
KatalogPerKontributorView,
UploadMateriView,
UploadMateriExcelView,
PasswordChangeView,
PasswordChangeViews,
password_success,
)
from app.forms import SuntingProfilForm, year_choices
......@@ -2363,7 +2363,7 @@ class ChangePasswordTest(TestCase):
self.kontributor = User.objects.create_contributor(email="kontributor@gov.id", password="kontributor")
self.admin = User.objects.create_admin(email="admin@gov.id", password="admin")
self.url = "/change-password/"
self.view = PasswordChangeView
self.view = PasswordChangeViews
self.template_name = "change-password.html"
def test_change_password_view(self):
......@@ -2398,7 +2398,4 @@ class ChangePasswordTest(TestCase):
# Logout
self.client.logout()
def test_change_password_anonymous(self):
# Test
response = self.client.get(self.url)
self.assertEqual(response.status_code, 403)
\ No newline at end of file
\ No newline at end of file
......@@ -5,7 +5,7 @@ from app.views import (DashboardKontributorView, ProfilKontributorView,
SuksesLoginAdminView, SuksesLoginKontributorView, DownloadHistoryView,
SuntingProfilView, UploadMateriHTML, UploadMateriView, UploadMateriExcelView,
ProfilAdminView, PostsView, SuntingProfilAdminView,
ReqMateriView, KatalogPerKontributorView, PasswordChangeView, password_success)
ReqMateriView, KatalogPerKontributorView, PasswordChangeViews, password_success)
from django.contrib.auth import views as auth_views
urlpatterns = [
path("", views.DaftarKatalog.as_view(), name="daftar_katalog"),
......@@ -37,6 +37,6 @@ urlpatterns = [
name="katalog-per-kontributor"),
path("materi/rate/", views.add_rating_materi, name="rate-materi"),
path("materi/<int:pk>/save-to-gdrive/", views.save_to_gdrive, name="save-to-gdrive"),
path("change-password/", PasswordChangeView.as_view(template_name='change-password.html')),
path("change-password/", PasswordChangeViews.as_view(template_name='change-password.html')),
path("password_success/", views.password_success, name="password_success"),
]
......@@ -701,7 +701,7 @@ def save_to_gdrive(request, pk):
return HttpResponseRedirect(reverse('detail-materi', kwargs={'pk': pk}))
class PasswordChangeView(PasswordChangeView):
class PasswordChangeViews(PasswordChangeView):
from_class = PasswordChangeForm
success_url = reverse_lazy('password_success')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment