Commit 1469c7d6 authored by Maël Kervella's avatar Maël Kervella

Pylint compliance on users

parent 4a1b97bb
......@@ -20,5 +20,12 @@
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""users
The app managing everything related to the users such as personal
informations or the right groups.
This is probably the most central app. It is strongly linked with
all the other because a user has devices (machines), a cotisation
(cotisations), a room (topologie)
"""
from .acl import *
......@@ -132,7 +132,7 @@ class UserAdmin(VersionAdmin, BaseUserAdmin):
)
# Need to reset the settings from BaseUserAdmin
# They are using fields we don't use like 'is_staff'
list_filter=()
list_filter = ()
fieldsets = (
(None, {'fields': ('pseudo', 'password')}),
(
......
......@@ -41,6 +41,10 @@ from django.utils import timezone
from django.contrib.auth.models import Group, Permission
from preferences.models import OptionalUser
from re2o.utils import remove_user_room
from re2o.mixins import FormRevMixin
from re2o.field_permissions import FieldPermissionFormMixin
from .models import (
User,
ServiceUser,
......@@ -52,9 +56,6 @@ from .models import (
Adherent,
Club
)
from re2o.utils import remove_user_room
from re2o.mixins import FormRevMixin
from re2o.field_permissions import FieldPermissionFormMixin
class PassForm(FormRevMixin, FieldPermissionFormMixin, forms.ModelForm):
......@@ -97,8 +98,8 @@ class PassForm(FormRevMixin, FieldPermissionFormMixin, forms.ModelForm):
def clean_selfpasswd(self):
"""Verifie si il y a lieu que le mdp self est correct"""
if not self.instance.check_password(
self.cleaned_data.get("selfpasswd")
):
self.cleaned_data.get("selfpasswd")
):
raise forms.ValidationError("Le mot de passe actuel est incorrect")
return
......
This diff is collapsed.
......@@ -22,11 +22,17 @@
# Maël Kervella
"""users.serializers
Serializers for the User app
"""
from rest_framework import serializers
from users.models import Club, Adherent
class MailingSerializer(serializers.ModelSerializer):
""" Serializer to build Mailing objects """
name = serializers.CharField(source='pseudo')
class Meta:
......@@ -35,6 +41,9 @@ class MailingSerializer(serializers.ModelSerializer):
class MailingMemberSerializer(serializers.ModelSerializer):
""" Serializer fot the Adherent objects (who belong to a
Mailing) """
class Meta:
model = Adherent
fields = ('email',)
......@@ -19,7 +19,10 @@
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""users.tests
The tests for the Users module.
"""
from django.test import TestCase
# from django.test import TestCase
# Create your tests here.
This diff is collapsed.
Markdown is supported
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