Skip to content

Instantly share code, notes, and snippets.

from datetime import datetime
from django.contrib.auth.models import User
def update_user_first_name(user_id, new_first_name):
return User.objects.filter(id=user_id).update(first_name=new_first_name)
def get_user_groups(user_id):
try: