Skip to content

Commit

Permalink
Some bugs fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
GonzzaG committed Jan 9, 2025
1 parent ee07c12 commit d7d8171
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion DEPLOYING.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ The following are the steps to perform a deployment in production. In case you w
- `CGDS_CHUNK_SIZE`: size **in bytes** of the chunk in which the files of a CGDS study are downloaded, the bigger it is, the faster the download is, but the more server memory it consumes. Default `2097152`, i.e. 2MB.
- `THRESHOLD_ORDINAL`: number of different values for the GEM (CNA) information to be considered ordinal, if the number is <= to this value then it is considered categorical/ordinal and a boxplot is displayed, otherwise, it is considered continuous and the common correlation graph is displayed. Default `5`.
- `THRESHOLD_GEM_SIZE_TO_COLLECT`: GEM file size threshold (in MB) for the GEM dataset to be available in memory. This has a HUGE impact on the performance of the analysis. If the size is less than or equal to this threshold, it is allocated in memory, otherwise, it will be read lazily from the disk. If None GGCA automatically allocates in memory when the GEM dataset size is small (<= 100MB). Therefore, if you want to force to always use RAM to improve performance you should set a very high threshold, on the contrary, if you want a minimum memory usage at the cost of poor performance, set it to `0`. Default `None`.
- `MIN_PASSWORD_LEN`: Defines the minimum required length for user passwords when updating their profile. If the provided password is shorter than this length, the update will be rejected.
- `MIN_PASSWORD_LEN`: Defines the minimum required length for user passwords when updating their profile. If the provided password is shorter than this length, the update will be rejected. Default `8`.
- PostgreSQL:
- `POSTGRES_USERNAME`: PostgreSQL connection username. **Must be equal to** `POSTGRES_USER`.
- `POSTGRES_PASSWORD`: PostgreSQL connection password. **Must be equal to** `POSTGRES_PASSWORD`.
Expand Down
10 changes: 5 additions & 5 deletions src/users/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ def update(self, instance, validated_data):
instance.last_name = validated_data.get('last_name', instance.last_name)

password = validated_data.pop('password', '')

minimum_password_len = settings.MIN_PASSWORD_LEN
password_length = len(password)

if password_length != 0:
minimum_password_len = settings.MIN_PASSWORD_LEN
if password_length < minimum_password_len:
raise ValidationError(f'Password must be at least {minimum_password_len} chars long')

instance.set_password(password)

else:
instance.set_password(password)
instance.save()
return instance

0 comments on commit d7d8171

Please sign in to comment.