Skip to content

Commit 508e048

Browse files
authored
Reset password (#60)
* updated travis yml file * removed xml files * passsword reset issue fixed, updated html design with django-crm theme, added named urls in templates * updated readme.rst file
1 parent ecc3e88 commit 508e048

18 files changed

+95
-72
lines changed

README.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ Django-CRM
44
Django CRM is opensourse CRM developed on django framework. It has all the basic features of CRM to start with. We welcome code contributions and feature requests via github.
55

66

7-
.. image:: https://coveralls.io/repos/github/MicroPyramid/Django-CRM/badge.svg?branch=master
8-
:target: https://coveralls.io/github/MicroPyramid/Django-CRM?branch=master
9-
107
.. image:: https://landscape.io/github/MicroPyramid/Django-CRM/master/landscape.svg?style=flat
118
:target: https://landscape.io/github/MicroPyramid/Django-CRM/master
129
:alt: Code Health
@@ -23,10 +20,19 @@ Django CRM is opensourse CRM developed on django framework. It has all the basic
2320
- Codacy
2421
- Support
2522
* - .. image:: https://travis-ci.org/MicroPyramid/Django-CRM.svg?branch=master
23+
:target: https://travis-ci.org/MicroPyramid/Django-CRM
2624
- .. image:: https://api.codacy.com/project/badge/Grade/b11da5f09dd542479fd3bd53944595d2
25+
:target: https://app.codacy.com/project/ashwin/Django-CRM/dashboard
26+
:alt: Codacy Dashboard
2727
.. image:: https://api.codacy.com/project/badge/Coverage/b11da5f09dd542479fd3bd53944595d2
28+
:target: https://app.codacy.com/project/ashwin/Django-CRM/dashboard
29+
:alt: Codacy Coverage
2830
- .. image:: https://badges.gitter.im/Micropyramid/Django-CRM.png
31+
:target: https://gitter.im/MicroPyramid/Django-CRM
32+
:alt: Gitter
2933
.. image:: https://www.codetriage.com/micropyramid/django-crm/badges/users.svg
34+
:target: https://www.codetriage.com/micropyramid/django-crm
35+
:alt: Code Helpers
3036

3137

3238
http://django-crm.readthedocs.io for latest documentation

common/urls.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
path('login/', LoginView.as_view(), name='login'),
1717
path('forgot-password/', ForgotPasswordView.as_view(), name='forgot_password'),
1818
path('logout/', LogoutView.as_view(), name='logout'),
19-
path('change-password/', ChangePasswordView.as_view(), name='change_pass'),
19+
path('change-password/', ChangePasswordView.as_view(), name='change_password'),
2020
path('profile/', ProfileView.as_view(), name='profile'),
2121

2222
# User views
@@ -26,9 +26,9 @@
2626
path('users/<int:pk>/view/', UserDetailView.as_view(), name='view_user'),
2727
path('users/<int:pk>/delete/', UserDeleteView.as_view(), name='remove_user'),
2828

29-
url(r'^password_reset/$',auth_views.password_reset,name='password_reset'),
30-
url(r'^passowrd-reset/done/$',auth_views.password_reset_done,name='password_reset_done'),
31-
url(r'^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
29+
path('password-reset/', auth_views.password_reset, name='password_reset'),
30+
path('password-reset/done/', auth_views.password_reset_done, name='password_reset_done'),
31+
path('reset/uidb64>/<token>/',
3232
auth_views.password_reset_confirm, name='password_reset_confirm'),
33-
url(r'^reset/done/$', auth_views.password_reset_complete, name='password_reset_complete'),
33+
path('reset/done/', auth_views.password_reset_complete, name='password_reset_complete'),
3434
]

crm/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@
128128

129129

130130
EMAIL_HOST = 'smtp.sendgrid.net'
131-
EMAIL_HOST_USER = '****'
132-
EMAIL_HOST_PASSWORD = '*******'
131+
EMAIL_HOST_USER = os.getenv('SG_USER', '')
132+
EMAIL_HOST_PASSWORD = os.getenv('SG_PWD', '')
133133
EMAIL_PORT = 587
134134
EMAIL_USE_TLS = True
135135

crm/urls.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
app_name = 'crm'
55

66
urlpatterns = [
7-
path('', include('common.urls', namespace="common")),
8-
path('accounts/', include('accounts.urls', namespace="accounts")),
9-
path('leads/', include('leads.urls', namespace="leads")),
10-
path('contacts/', include('contacts.urls', namespace="contacts")),
11-
path('opportunities/', include('opportunity.urls', namespace="opportunities")),
12-
path('cases/', include('cases.urls', namespace="cases")),
13-
path('emails/', include('emails.urls', namespace="emails")),
14-
# path('planner/', include('planner.urls', namespace="planner")),
15-
path('logout/', views.logout, {'next_page': '/login/'}, name="logout"),
7+
path('', include('common.urls', namespace="common")),
8+
path('', include('django.contrib.auth.urls')),
9+
path('accounts/', include('accounts.urls', namespace="accounts")),
10+
path('leads/', include('leads.urls', namespace="leads")),
11+
path('contacts/', include('contacts.urls', namespace="contacts")),
12+
path('opportunities/', include('opportunity.urls', namespace="opportunities")),
13+
path('cases/', include('cases.urls', namespace="cases")),
14+
path('emails/', include('emails.urls', namespace="emails")),
15+
# path('planner/', include('planner.urls', namespace="planner")),
16+
path('logout/', views.logout, {'next_page': '/login/'}, name="logout"),
1617
]

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Django==2.1
1+
Django==2.0.7
22
django-simple-pagination==1.1.8
33
pytz==2018.3
44
psycopg2-binary==2.7.4

static/css/main.scss

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,15 @@ a{
6767
.form-group {
6868
margin-bottom: 15px;
6969
}
70+
.errorlist li{
71+
color: red;
72+
}
7073
label {
71-
font-size: 12px;
74+
font-size: 14px;
7275
color: darken($text_color2, 15%);
7376
font-weight:500;
7477
}
75-
.form-control {
78+
.form-control, input {
7679
color: $text_color;
7780
min-height: 40px;
7881
font-size: 13px;

templates/base.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
2727
<span class="navbar-toggler-icon"></span>
2828
</button>
29-
29+
{% if request.user.is_authenticated %}
3030
<div class="collapse navbar-collapse" id="navbarSupportedContent">
3131
<ul class="navbar-nav mr-auto">
3232
{% if request.user.role == "ADMIN" %}
@@ -53,14 +53,15 @@
5353
{% endwith %}
5454
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
5555
{% if request.user.role == "USER" %}
56-
<a class="dropdown-item" href="/change-password/"><i class="fas fa-key"></i> Change Password</a>
56+
<a class="dropdown-item" href="{% url 'common:change_password' %}"><i class="fas fa-key"></i> Change Password</a>
5757
{% endif %}
5858
<a class="dropdown-item" href="{% url 'common:profile' %}"><i class="fas fa-user"></i> Profile</a>
5959
<a class="dropdown-item" href="{% url 'common:logout' %}"><i class="fas fa-sign-out-alt"></i> Logout</a>
6060
</div>
6161
</li>
6262
</ul>
6363
</div>
64+
{% endif %}
6465
</nav>
6566
</header>
6667
<!-- header ends here -->
@@ -88,7 +89,7 @@
8889
<script type="text/javascript">
8990
$(document).ready(function(){
9091
word = window.location.pathname.split('/')[1]
91-
$('#'+word).addClass('active')
92+
$('#' + word).addClass('active')
9293
})
9394
</script>
9495
</body>

templates/change_password.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,23 @@
1212
</div>
1313
<div class="row marl no-gutters">
1414
<div class="col-md-12">
15-
1615
{% if not user_obj %}
1716
<div class="filter_col col-md-12">
1817
<div class="form-group">
1918
<label for="exampleInputEmail1">Old Password</label>
20-
<input type="password" class="form-control" name="CurrentPassword" value="{{request.POST.CurrentPassword}}">
19+
<input type="password" class="form-control" name="CurrentPassword" value="{{ request.POST.CurrentPassword }}">
2120
</div>
2221
<span class="error">{{ errors.CurrentPassword }}</span>
2322
{% if error %}
24-
<span class="error">{{error}}</span>
23+
<span class="error">{{ error }}</span>
2524
{% endif %}
2625
</div>
2726
{% endif %}
2827
{% if not user_obj %}
2928
<div class="filter_col col-md-12">
3029
<div class="form-group">
3130
<label for="exampleInputEmail1">New Password</label>
32-
<input type="password" class="form-control" name="Newpassword" value="{{request.POST.Newpassword}}">
31+
<input type="password" class="form-control" name="Newpassword" value="{{ request.POST.Newpassword }}">
3332
</div>
3433
<span class="error">{{ errors.Newpassword }}</span>
3534
</div>
@@ -38,7 +37,7 @@
3837
<div class="filter_col col-md-12">
3938
<div class="form-group">
4039
<label for="exampleInputEmail1">Confirm New Password</label>
41-
<input type="password" class="form-control" name="confirm" value="{{request.POST.confirm}}">
40+
<input type="password" class="form-control" name="confirm" value="{{ request.POST.confirm }}">
4241
</div>
4342
<span class="error">{{ errors.confirm }}</span>
4443
</div>

templates/forgot_password.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@
3232
<div class="form-group">
3333
<input type="text" class="form-control" id="exampleInputEmail1" placeholder="Email" name="email">
3434
</div>
35-
36-
<div class="forgot">Back to login <a href="/login/">Click Here?</a></div>
35+
<div class="forgot">Back to login <a href="{% url "common:login" %}">Click Here?</a></div>
3736
<button type="submit" class="btn btn-danger">Reset Password</button>
3837
</form>
3938
</div>

templates/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
{% extends 'base.html' %}
2-
<a href="/logout/"><button class="btn btn-primary" type="button">Logout</button></a
2+
<a href="{% url "common:logout" %}"><button class="btn btn-primary" type="button">Logout</button></a

0 commit comments

Comments
 (0)