Skip to content

Commit

Permalink
Merge pull request #145 from edwardchalstrey1/Qing
Browse files Browse the repository at this point in the history
Merge upstream Qing branch 16th May 2024
  • Loading branch information
edwardchalstrey1 authored May 16, 2024
2 parents 720f93b + 2c7504a commit 83bce4f
Show file tree
Hide file tree
Showing 7 changed files with 2,830 additions and 1 deletion.
1 change: 1 addition & 0 deletions seshat/apps/accounts/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class Meta:
}



class CustomSignUpForm(UserCreationForm):
# Your other form fields

Expand Down
8 changes: 7 additions & 1 deletion seshat/apps/core/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
from crispy_forms.layout import Submit
from django.core.exceptions import ValidationError

from django_recaptcha.fields import ReCaptchaField


#from .models import Religion

Expand Down Expand Up @@ -340,7 +342,11 @@ class SeshatCommentForm2(forms.Form):
formset = CommentPartFormSet(prefix='commentpart')
formset.management_form # Include the management form



class SignUpForm(UserCreationForm):
captcha = ReCaptchaField()

# first_name = forms.CharField(
# max_length=30, required=False, help_text='Optional.')
# last_name = forms.CharField(
Expand Down Expand Up @@ -370,7 +376,7 @@ def clean_email(self):
class Meta:
model = User
fields = ('username', 'first_name', 'last_name',
'email', 'password1', 'password2', )
'email', 'password1', 'password2', 'captcha')
widgets = {
'first_name': forms.TextInput(
attrs={'class': 'form-control mb-3', }),
Expand Down
2,807 changes: 2,807 additions & 0 deletions seshat/apps/core/templates/core/old_codebook.html

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions seshat/apps/core/templates/core/signup_traditional.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ <h3>Sign up for a Seshat account:</h3>
{{ form.password2|as_crispy_field }}
</div>
</div>
{{ form.captcha }}

<button class="btn btn-primary col-12 fa-lg gradient-custom-2 mb-3 me-3 mt-3" type="submit"> &nbsp; &nbsp; <strong>Sign up</strong> &nbsp; &nbsp; </button>
</form>
</div>
Expand Down
1 change: 1 addition & 0 deletions seshat/apps/core/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
urlpatterns = [path('', views.seshatindex, name='seshat-index'),]
urlpatterns += [path('methods/', views.seshatmethods, name='seshat-methods'),]
urlpatterns += [path('whoweare/', views.seshatwhoweare, name='seshat-whoweare'),]
urlpatterns += [path('codebook', views.seshatcodebookold, name='seshat-codebook'),]
urlpatterns += [path('downloads_page/', views.seshatolddownloads, name='seshat-olddownloads'),]
urlpatterns += [path('acknowledgements/', views.seshatacknowledgements, name='seshat-acknowledgements'),]
urlpatterns += [path('download_oldcsv/<str:file_name>/', views.download_oldcsv, name='download_oldcsv'),]
Expand Down
7 changes: 7 additions & 0 deletions seshat/apps/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,13 @@ def seshatolddownloads(request):
}
return render(request, 'core/old_downloads.html', context=context)

def seshatcodebookold(request):
context = {
'insta': "Instabilities All Over the Place..",
}
return render(request, 'core/old_codebook.html', context=context)


def seshatacknowledgements(request):
context = {
'insta': "Instabilities All Over the Place..",
Expand Down
5 changes: 5 additions & 0 deletions seshat/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
'django.contrib.gis',
'leaflet',
#'easyaudit',
'django_recaptcha',
]

AUTHENTICATION_BACKENDS = [
Expand All @@ -91,6 +92,10 @@

]


RECAPTCHA_PUBLIC_KEY = config('GOOGLE_RECAPTCHA_SITE_KEY')
RECAPTCHA_PRIVATE_KEY = config('GOOGLE_RECAPTCHA_SECRET_KEY')

# all-auth
LOGIN_REDIRECT_URL = 'seshat-index'
ACCOUNT_LOGOUT_REDIRECT = 'seshat-index'
Expand Down

0 comments on commit 83bce4f

Please sign in to comment.