Skip to content

Jobs feature, lets unverified users use site/see profile#9

Merged
LaneyCommits merged 2 commits intomainfrom
jobs_feature
Mar 17, 2026
Merged

Jobs feature, lets unverified users use site/see profile#9
LaneyCommits merged 2 commits intomainfrom
jobs_feature

Conversation

@0xBlue2
Copy link
Copy Markdown
Collaborator

@0xBlue2 0xBlue2 commented Mar 13, 2026

Summary

This PR adds a database-backed jobs feature, improves account/profile behavior (including unverified users), enhances admin management for users, and makes the resources page look similar to the general website styling.

Notes

  • Jobs are currently read from the database, and can be added/modified in the admin panel
    • All of the jobs in the DB currently are examples
  • The test "emails" are still sent to the terminal when a user signs up, but now they are allowed to use the rest of the website without verifying

Changes

Jobs feature

  • New jobs app

    • Added JobMajor model to mirror the existing major “pill” keys across quiz/resume/colleges.
      • key: internal major key (e.g. computer_science, business, engineering).
      • label: human-friendly label shown to students.
    • Added Job model for jobs/internships:
      • Fields: title, company, city, state, is_remote, employment_type (internship/full-time/part-time), url, description, posted_at, source, is_active, timestamps.
      • Many-to-many to JobMajor so each job can target multiple majors.
  • Admin integration

    • Registered JobMajor and Job in jobs/admin.py with search, list filters, and a horizontal major selector.
    • Added help text for JobMajor.key and JobMajor.label to clarify internal keys vs display labels.
  • Example data and seeding

    • Added jobs/example_jobs.py with curated US example jobs/internships mapped to existing major keys.
    • Added management command seed_jobs:
      • Run with python manage.py seed_jobs
      • Creates JobMajor rows from career_quiz.quiz_data.MAJORS.
      • Seeds example Job records and attaches the correct majors.
  • User-facing jobs page

    • New route /jobs/ wired via jobs/urls.py and config/urls.py (namespace: jobs).
    • New template templates/jobs/home.html:
      • Filters: major, type, state (two-letter code), remote-only.
      • Job cards show title/company, location/remote, type, posted date, description, and major pills.
    • Filter logic in jobs/views.py:
      • Starts from Job.objects.filter(is_active=True).
      • Applies filters only when values are present.
      • State filtering is skipped if the state input is blank/whitespace or not exactly two letters (prevents filtering on empty state).
  • Navigation

    • Updated templates/base.html:
      • Added Jobs to the header nav.
      • Added Browse jobs to the footer “Explore” links.

Accounts and profiles

  • Profiles are created even if email is unverified

    • On signup: create a Profile immediately, then send verification email.
    • On login: ensure Profile exists (safety net for older users).
    • Verification link now marks profile.email_verified = True instead of creating the profile.
    • profile_view and personalization_view now use get_or_create, so users can access these pages even if unverified.
  • Account button behavior

    • Header account icon:
      • If authenticated: links to Profile.
      • If not authenticated: links to Login.
  • Logout UX

    • Added a Log out link in the header when signed in.
    • Added a Log out link on the profile page.
  • Email verification status in profile

    • templates/accounts/profile.html shows verified/unverified status and a link back to the verification instructions page when unverified.

Admin: user management

  • Added accounts/admin.py that:
    • Unregisters the default User admin and re-registers a customized one.
    • Shows an Email verified? boolean column derived from user.profile.email_verified.
    • Adds a Profile inline on the user admin page for quick editing.
    • Registers Profile and EmailVerification models for direct management with helpful list/search settings.
  • Added help text to Profile.email_verified to clarify meaning and impact.

Auth UI / CTA styling

  • Updated templates/accounts/verify_email_sent.html so the “Go to home” CTA uses the btn btn-header styling and is not affected by auth-page link styling.

Testing / How to validate

  • Migrations + seed
    • python manage.py makemigrations jobs
    • python manage.py migrate
    • python manage.py seed_jobs
  • Jobs page
    • Visit /jobs/ and confirm listings render and filters work (including “State=Any/blank” not filtering).
  • Admin
    • Visit /admin/:
      • Verify user list shows “Email verified?” and profile inline is available.
      • Verify Job/JobMajor are manageable.
  • Accounts
    • Sign up, log in/out, and confirm profile loads even when email is unverified and shows verification status.

@LaneyCommits LaneyCommits merged commit 29d3a73 into main Mar 17, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants