Skip to content

Commit

Permalink
Merge branch 'dev' into TUP-25-Procesamiento-de-documento-Sysacad
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Eduardo Ferreyra <[email protected]>
  • Loading branch information
carlosferreyra authored Aug 30, 2024
2 parents 2d1e918 + ccfb6c8 commit 33e6f5c
Show file tree
Hide file tree
Showing 8 changed files with 124 additions and 5 deletions.
19 changes: 19 additions & 0 deletions backend/alumnos/migrations/0003_alumno_cuil.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 5.1 on 2024-08-28 19:37

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('alumnos', '0002_alumno_anio_ingreso_alumno_apellido_alumno_celular_and_more'),
]

operations = [
migrations.AddField(
model_name='alumno',
name='cuil',
field=models.IntegerField(default=123),
preserve_default=False,
),
]
18 changes: 18 additions & 0 deletions backend/alumnos/migrations/0004_alter_alumno_cuil.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 5.1 on 2024-08-28 20:04

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('alumnos', '0003_alumno_cuil'),
]

operations = [
migrations.AlterField(
model_name='alumno',
name='cuil',
field=models.CharField(blank=True, max_length=11, null=True),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generated by Django 5.1 on 2024-08-28 20:08

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('alumnos', '0004_alter_alumno_cuil'),
]

operations = [
migrations.AlterField(
model_name='alumno',
name='celular',
field=models.CharField(blank=True, max_length=14, null=True),
),
migrations.AlterField(
model_name='alumno',
name='dni',
field=models.CharField(max_length=8),
),
migrations.AlterField(
model_name='alumno',
name='telefono',
field=models.CharField(blank=True, max_length=14, null=True),
),
]
18 changes: 18 additions & 0 deletions backend/alumnos/migrations/0006_alter_alumno_legajo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 5.1 on 2024-08-28 20:21

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('alumnos', '0005_alter_alumno_celular_alter_alumno_dni_and_more'),
]

operations = [
migrations.AlterField(
model_name='alumno',
name='legajo',
field=models.CharField(max_length=6),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Generated by Django 5.1 on 2024-08-28 20:44

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('alumnos', '0006_alter_alumno_legajo'),
]

operations = [
migrations.AlterField(
model_name='alumno',
name='celular',
field=models.IntegerField(blank=True, null=True),
),
migrations.AlterField(
model_name='alumno',
name='dni',
field=models.IntegerField(),
),
migrations.AlterField(
model_name='alumno',
name='legajo',
field=models.IntegerField(),
),
migrations.AlterField(
model_name='alumno',
name='telefono',
field=models.IntegerField(blank=True, null=True),
),
]
3 changes: 2 additions & 1 deletion backend/alumnos/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ class Alumno(models.Model):
legajo = models.IntegerField(unique=True)
dni = models.IntegerField(primary_key=True)
estado = models.CharField(max_length=255)
# estado = models.ForeignKey("TipoEstado", on_delete=models.CASCADE)
#estado = models.ForeignKey("TipoEstado", on_delete=models.CASCADE)
cuil = models.IntegerField()
anio_ingreso = models.IntegerField()
telefono = models.IntegerField(blank=True, null=True)
celular = models.IntegerField(blank=True, null=True)
Expand Down
6 changes: 4 additions & 2 deletions backend/alumnos/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class AlumnoRetrieveSerializer(serializers.ModelSerializer):

class Meta:
model = Alumno
exclude = ['telefono', 'celular', 'user', "id"]
exclude = ['telefono', 'celular', 'user', "id","cuil"]


def get_alumno_link(self, obj):
Expand All @@ -25,11 +25,13 @@ def get_alumno_link(self, obj):

class AlumnoCreateSerializer(serializers.ModelSerializer):
email = serializers.SerializerMethodField()

cuil = serializers.IntegerField(required=False)

class Meta:
model = Alumno
fields = "__all__"


def get_email(self,obj):
user_email = obj.user
if user_email is not None:
Expand Down
4 changes: 2 additions & 2 deletions backend/server/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@
# dj-rest-auth settings (with Registration & JWT enabled)
# https://dj-rest-auth.readthedocs.io/en/latest/configuration.html
REST_AUTH = {
# "LOGIN_SERIALIZER": "users.serializers.CustomLoginSerializer",
"LOGIN_SERIALIZER": "dj_rest_auth.serializers.LoginSerializer", # default
"LOGIN_SERIALIZER": "users.serializers.CustomLoginSerializer",
#"LOGIN_SERIALIZER": "dj_rest_auth.serializers.LoginSerializer", # default
"TOKEN_SERIALIZER": "dj_rest_auth.serializers.TokenSerializer",
# jwt settings
# "JWT_SERIALIZER": "api.serializers.CustomJWTSerializerWithExpiration", custom jwt serializer
Expand Down

0 comments on commit 33e6f5c

Please sign in to comment.