Skip to content

Commit 95df6a0

Browse files
authored
Merge pull request #308 from pytition/test_django_4.2
Update to Django 4.2
2 parents 6fb8d0c + cab2284 commit 95df6a0

File tree

21 files changed

+203
-223
lines changed

21 files changed

+203
-223
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ RUN mkdir /mediaroot
1313
WORKDIR /code
1414
COPY requirements.txt requirements_dev.txt /code/
1515
RUN pip install -r requirements_dev.txt
16-
RUN pip install psycopg2-binary==2.8.4
16+
RUN pip install "psycopg[binary]==3.1.8"
1717
COPY . /code/
1818
COPY pytition/pytition/settings/config_example.py /config/docker_config.py
1919
RUN touch /config/__init__.py

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ node {
88

99
sh '''
1010
cd $WORKSPACE
11-
rm -rf venv && virtualenv -p python3 venv
11+
rm -rf venv && python3 -m venv venv
1212
. venv/bin/activate
1313
pip3 install -r requirements_dev.txt
1414
cat <<ENDOFFILE > my.cnf

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ Those are external projects that are needed and used by Pytition, but included i
5454

5555
## Dependencies
5656

57-
* Python 3
58-
* Django 2.2.x
59-
* django-tinymce 2.8.0
60-
* django-colorfield 0.1.15
57+
* Python 3.8 up to 3.11
58+
* Django 4.2.x
59+
* django-tinymce 3.5.0
60+
* django-colorfield 0.8.0
6161
* requests 2.20.x
62-
* mysqlclient 1.3.13
62+
* mysqlclient 2.0.1
6363
* beautifulsoup4 4.6.3
64-
* django-formtools 2.1
64+
* django-formtools 2.2
6565
* bcrypt
6666

6767
## Translations

dev/INSTALL.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ In a production environment you should modify the following settings:
2424

2525
### Setup your customization
2626

27-
You can customize the TinyMCE variables:
27+
You can customize the TinyMCE editor via this variable:
2828

29-
* TINYMCE_JS_URL
3029
* TINYMCE_DEFAULT_CONFIG
3130

3231
### Setup mysql credentials

doc/configuration.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ You **must** set the following variables:
1313
.. automodule:: pytition.settings.config_example
1414
:members:
1515

16-
.. warning:: The ``TINYMCE_JS_URL`` setting must be present in your config file if you modified the ``STATIC_URL`` setting from its default value (``/static/``), either before of after the ``DO NOT EDIT AFTER THIS BANNER``. It is already present in the config_example.py file.
17-
1816
Not mandatory but important settings
1917
====================================
2018

doc/installation.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,6 @@ Those are:
125125
* DATABASES
126126
* ALLOWED_HOSTS
127127

128-
.. warning:: If you do not use the ``config_example.py`` sample file as a base for your config, do NOT forget to also set ``TINYMCE_JS_URL``. Most likely you will just need to set it to ``STATIC_URL + TINYMCE_JS_PATH``
129-
130128
.. note:: Do not forget to put a correct path to your `my.cnf` MySQL credential file in your config `DATABASES` setting.
131129

132130
Initialize Pytition project database. Pay attention to be in your virtualenv to enter the following commands:

doc/multi-domain-install.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,6 @@ Those are:
125125
* DATABASES
126126
* ALLOWED_HOSTS
127127

128-
.. warning:: If you do not use the ``config_example.py`` sample file as a base for your config, do NOT forget to also set ``TINYMCE_JS_URL``. Most likely you will just need to set it to ``STATIC_URL + TINYMCE_JS_PATH``
129-
130128
.. warning:: Pay attention to the following config values:
131129

132130
.. code-block:: none

pytition/locale/fr_FR/LC_MESSAGES/django.po

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version: Pytition\n"
99
"Report-Msgid-Bugs-To: \n"
1010
"POT-Creation-Date: 2022-08-15 21:12+0200\n"
11-
"PO-Revision-Date: 2022-08-15 21:15+0200\n"
11+
"PO-Revision-Date: 2023-10-14 11:18+0200\n"
1212
"Last-Translator: Yann Sionneau <[email protected]>\n"
1313
"Language-Team: French (France) <https://weblate.framasoft.org/projects/"
1414
"pytition/pytitions/fr_FR/>\n"
@@ -17,7 +17,7 @@ msgstr ""
1717
"Content-Type: text/plain; charset=UTF-8\n"
1818
"Content-Transfer-Encoding: 8bit\n"
1919
"Plural-Forms: nplurals=2; plural=n > 1;\n"
20-
"X-Generator: Poedit 2.3\n"
20+
"X-Generator: Poedit 3.0.1\n"
2121

2222
#: pytition/petition/admin.py:21 pytition/petition/models.py:87
2323
#: pytition/petition/models.py:502
@@ -638,7 +638,7 @@ msgstr "Utilisateur lié à ces permissions"
638638

639639
#: pytition/petition/models.py:655
640640
msgid "message"
641-
msgstr "Message"
641+
msgstr "message"
642642

643643
#: pytition/petition/templates/layouts/base.html:12
644644
msgid "Homepage"
@@ -2073,7 +2073,7 @@ msgstr ""
20732073

20742074
#: pytition/petition/views.py:1724
20752075
msgid "Petition successfully transfered!"
2076-
msgstr "Permissions transférée avec succès !"
2076+
msgstr "Pétition transférée avec succès !"
20772077

20782078
#: pytition/petition/views.py:1727
20792079
msgid "Something went wrong while transferring this petition."

pytition/petition/admin.py

Lines changed: 140 additions & 140 deletions
Large diffs are not rendered by default.

pytition/petition/forms.py

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from django.forms import ModelForm, ValidationError
22
from django import forms
3-
from django.utils.translation import ugettext_lazy as _
3+
from django.utils.translation import gettext_lazy as _
44
from django.contrib.auth.forms import UserCreationForm, UsernameField
55
from django.contrib.auth import get_user_model
66
from django.utils.text import slugify
@@ -10,7 +10,6 @@
1010
from .widgets import SwitchField
1111
from .helpers import send_welcome_mail
1212

13-
import uuid
1413
import html
1514
from tinymce.widgets import TinyMCE
1615
from colorfield.fields import ColorWidget
@@ -47,16 +46,6 @@ def __init__(self, petition=None, *args, **kwargs):
4746
else:
4847
self.fields['subscribed_to_mailinglist'].label = self.instance.petition.newsletter_text
4948

50-
def save(self, commit=True):
51-
object = super().save(commit=False)
52-
hashstring = str(uuid.uuid4())
53-
object.confirmation_hash = hashstring
54-
object.confirmed = False
55-
if commit:
56-
object.save()
57-
return object
58-
59-
6049
class PetitionCreationStep1(forms.Form):
6150
### Ask for title ###
6251
title = forms.CharField(max_length=200)
@@ -105,7 +94,7 @@ class PetitionCreationStep3(forms.Form):
10594

10695
class ContentFormGeneric(forms.Form):
10796
### Content of a Petition ###
108-
text = forms.CharField(widget=TinyMCE)
97+
text = forms.CharField(widget=TinyMCE, required=False)
10998
target = forms.IntegerField(required=False)
11099
side_text = forms.CharField(widget=TinyMCE, required=False)
111100
footer_text = forms.CharField(widget=TinyMCE, required=False)
@@ -184,10 +173,10 @@ def clean(self):
184173

185174
class StyleForm(forms.Form):
186175
### Graphical UI style info of Petition ###
187-
bgcolor = forms.CharField(widget=ColorWidget)
188-
linear_gradient_direction = forms.ChoiceField(choices=Petition.LINEAR_GRADIENT_CHOICES)
189-
gradient_from = forms.CharField(widget=ColorWidget)
190-
gradient_to = forms.CharField(widget=ColorWidget)
176+
bgcolor = forms.CharField(widget=ColorWidget, required=False)
177+
linear_gradient_direction = forms.ChoiceField(choices=Petition.LINEAR_GRADIENT_CHOICES, required=False)
178+
gradient_from = forms.CharField(widget=ColorWidget, required=False)
179+
gradient_to = forms.CharField(widget=ColorWidget, required=False)
191180

192181

193182
class PytitionUserCreationForm(UserCreationForm):

0 commit comments

Comments
 (0)