Skip to main content

Overview

Every user in Inventario has a customizable profile where they can manage personal information, upload photos, change passwords, and configure preferences like tutorial visibility.

User Profile Model

User profiles are built into the Usuario model:
The profile supports both uploaded photos and photos from Google OAuth authentication.

Profile View

Accessing Your Profile

Users can view and edit their profile information at the profile page:
applications/cuentas/views.py

Profile Information

Basic Info

Username, first name, last name, and email

Contact Details

Phone number and verified email status

Profile Photo

Uploaded image or Google profile photo

Role Badge

Admin or Vendedor role display

Updating Profile Information

Profile Update Form

The profile form validates and updates user information:

Form Validation

The form includes comprehensive validation:
  • Cannot be empty
  • Must be unique (case-insensitive)
  • Excludes current user when checking for duplicates
Names must contain only letters (including accented characters) and spaces.

Update Profile Handler

applications/cuentas/views.py
The profile form automatically handles image uploads through Django’s file handling system.

Profile Photo Management

Uploading Photos

Users can upload custom profile photos:
1

Select Photo

Choose an image file from your device.
2

Automatic Upload

The photo is saved to media/fotos_perfil/ directory:
3

Display

The uploaded photo is displayed throughout the application.

Google Profile Photos

When users authenticate with Google OAuth, their profile photo is automatically captured:
Priority System: Google photos are only saved if the user doesn’t already have an uploaded profile photo. Users can override Google photos by uploading their own.

Photo Display Logic

Password Management

Changing Password

Users can change their password at any time:
1

Verify Current Password

User must enter their current password for security.
2

Enter New Password

New password must meet validation requirements:
  • Minimum 8 characters
  • Cannot be too common
  • Must contain numbers and letters
3

Confirm New Password

Re-enter the new password to confirm.
4

Update Session

update_session_auth_hash() prevents logout after password change.

Forced Password Change

New vendedor accounts are created with debe_cambiar_password=True:
Users with debe_cambiar_password=True are automatically redirected to the password change page until they update their password.

Tutorial Settings

First-Time Tutorial

Inventario displays an interactive tutorial for new users:
applications/cuentas/views.py

Tutorial Model Field

applications/cuentas/models.py
The tutorial is automatically shown once when a user first accesses the dashboard. After viewing, tutorial_visto is set to True and the tutorial won’t display again.

Marking Tutorial as Viewed

Users can manually dismiss the tutorial:
applications/cuentas/views.py
Admin Feature: Admins could potentially reset tutorial_visto to False to show the tutorial again to specific users.

Invoice Configuration (Admin Only)

Admins can configure invoice settings from their profile:

Invoice Settings Access Control

applications/cuentas/views.py
Only users with the Admin role can modify invoice configuration settings. Vendedores cannot access these settings.

Invoice Configuration Options

Company Info

Business name, address, phone, and contact email

Custom Message

Personalized message displayed on invoices

Visibility Toggles

Show/hide address, phone, email, and message on invoices

Auto-Creation

Configuration object is automatically created when first accessed

Email Verification Status

The profile displays email verification status:
applications/cuentas/models.py
Email verification is completed during the registration process. Users cannot change their email verification status directly.

Profile Best Practices

  • Use clear, professional photos
  • Recommended size: 400x400 pixels
  • Supported formats: JPG, PNG, GIF
  • Maximum file size depends on server configuration
  • Change default passwords immediately
  • Use strong, unique passwords
  • Keep email address up to date
  • Verify email addresses for password recovery
  • Keep contact information current
  • Use real names for better communication
  • Update phone numbers if they change
  • Ensure email addresses are monitored

API Endpoints

View
Display user profile and settings
Update
Update profile information and photo
View
Display password change form
Update
Process password change request
Update
Mark tutorial as viewed (AJAX endpoint)

Authentication

Learn about login and password recovery

User Roles

Understand role-based permissions

Configuration

System-wide configuration options

Invoice Settings

Learn more about invoice generation