Skip to content

Commit

Permalink
Update backend deps 20240408 and GUI default lang
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikek committed Apr 8, 2024
1 parent e911d02 commit 2170a46
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 14 deletions.
18 changes: 18 additions & 0 deletions ESSArch_Core/auth/migrations/0027_alter_userprofile_language.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 5.0.3 on 2024-04-08 08:24

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('essauth', '0026_alter_groupmemberrole_codename_and_more'),
]

operations = [
migrations.AlterField(
model_name='userprofile',
name='language',
field=models.CharField(default='DEFAULT', max_length=10),
),
]
2 changes: 1 addition & 1 deletion ESSArch_Core/auth/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ def default_ip_list_columns():

user = models.OneToOneField(DjangoUser, on_delete=models.CASCADE, related_name='user_profile')
current_organization = models.ForeignKey(Group, on_delete=models.SET_NULL, null=True)
language = models.CharField(max_length=10, default='')
language = models.CharField(max_length=10, default='DEFAULT')
ip_list_columns = PickledObjectField(default=default_ip_list_columns)
ip_list_view_type = models.CharField(max_length=10, choices=IP_LIST_VIEW_CHOICES, default=IP,)
file_browser_view_type = models.CharField(max_length=10, choices=FILE_BROWSER_LIST_VIEW_CHOICES, default=LIST, )
Expand Down
9 changes: 2 additions & 7 deletions ESSArch_Core/auth/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,8 @@ def user_post_save(sender, instance, created, *args, **kwargs):
@receiver(user_logged_in)
def user_logged_in(sender, user, request, **kwargs):
if user.user_profile.language == '':
cookie_language = request.COOKIES.get('essarch_language')
if cookie_language:
user.user_profile.language = cookie_language
else:
user.user_profile.language = 'DEFAULT'

user.user_profile.save()
user.user_profile.language = 'DEFAULT'
user.user_profile.save(update_fields=['language'])

Check warning on line 82 in ESSArch_Core/auth/signals.py

View check run for this annotation

Codecov / codecov/patch

ESSArch_Core/auth/signals.py#L81-L82

Added lines #L81 - L82 were not covered by tests

host = request.META.get('REMOTE_ADDR')
if host is None:
Expand Down
10 changes: 5 additions & 5 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
asgiref==3.7.2
boto3==1.34.69
boto3==1.34.80
celery[tblib]==5.3.6
cffi==1.16.0
channels==4.0.0 ; platform_system=='Linux'
channels==4.1.0 ; platform_system=='Linux'
channels==3.0.5 ; platform_system=='Windows'
channels_redis==4.1.0
chardet==5.1.0
Expand All @@ -11,7 +11,7 @@ cryptography==42.0.5
daphne==4.1.0 ; platform_system=='Linux'
daphne==3.0.2 ; platform_system=='Windows'
dj-rest-auth[with_social]==5.0.2
django==5.0.3
django==5.0.4
django-allauth==0.57.0
django-cors-headers==4.3.1
django-countries-plus==2.2.0
Expand All @@ -23,7 +23,7 @@ django-guardian==2.4.0
django-languages-plus==2.1.1
django-mptt==0.16
django-nested-inline==0.4.6
django-picklefield==3.1
django-picklefield==3.2
django-redis==5.4.0
django-relativity==0.2.6
djangorestframework==3.15.1
Expand All @@ -45,7 +45,7 @@ lxml==5.1.0
msoffcrypto-tool==5.3.1
natsort==8.4.0
opf-fido==1.6.1
pyfakefs==5.3.5
pyfakefs==5.4.0
python-dateutil==2.8.2
pywin32==306 ; platform_system=='Windows'
redis==5.0.3
Expand Down
2 changes: 1 addition & 1 deletion requirements/optional.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
django-auth-ldap==4.7.0
django-auth-ldap==4.8.0
django-auto-logout==0.5.1
django-axes==6.3.0
pysaml2 @ git+https://github.com/ESSolutions/pysaml2.git@2f1ba6beaef3f6189ace26e0efb5f2d031624e04 ; platform_system=='Windows'
Expand Down

0 comments on commit 2170a46

Please sign in to comment.