mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-07-10 23:02:47 +02:00
refactor: remove unused utils
This commit is contained in:
@@ -1,16 +0,0 @@
|
|||||||
from django.contrib.auth import get_user_model
|
|
||||||
from apps.users.models import UserSettings
|
|
||||||
|
|
||||||
|
|
||||||
User = get_user_model()
|
|
||||||
|
|
||||||
|
|
||||||
def ensure_user_settings(user):
|
|
||||||
"""
|
|
||||||
Check if the given user has a UserSettings model.
|
|
||||||
If not, create one.
|
|
||||||
"""
|
|
||||||
if not hasattr(user, "settings"):
|
|
||||||
UserSettings.objects.create(user=user)
|
|
||||||
|
|
||||||
return user.settings
|
|
||||||
Reference in New Issue
Block a user