mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	Adds backend code for the mute users feature. This is just infrastructure work (database interactions, helpers, tests, events, API docs etc) and does not involve any behavioral/semantic aspects of muted users. Adds POST and DELETE endpoints, to keep the URL scheme mostly consistent in terms of `users/me`. TODOs: 1. Add tests for exporting `zulip_muteduser` database table. 2. Add dedicated methods to python-zulip-api to be used in place of the current `client.call_endpoint` implementation.
		
			
				
	
	
		
			48 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			48 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
# Generated by Django 3.1.5 on 2021-02-12 12:10
 | 
						|
 | 
						|
import django.db.models.deletion
 | 
						|
import django.utils.timezone
 | 
						|
from django.conf import settings
 | 
						|
from django.db import migrations, models
 | 
						|
 | 
						|
 | 
						|
class Migration(migrations.Migration):
 | 
						|
 | 
						|
    dependencies = [
 | 
						|
        ("zerver", "0313_finish_is_user_active_migration"),
 | 
						|
    ]
 | 
						|
 | 
						|
    operations = [
 | 
						|
        migrations.CreateModel(
 | 
						|
            name="MutedUser",
 | 
						|
            fields=[
 | 
						|
                (
 | 
						|
                    "id",
 | 
						|
                    models.AutoField(
 | 
						|
                        auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
 | 
						|
                    ),
 | 
						|
                ),
 | 
						|
                ("date_muted", models.DateTimeField(default=django.utils.timezone.now)),
 | 
						|
                (
 | 
						|
                    "muted_user",
 | 
						|
                    models.ForeignKey(
 | 
						|
                        on_delete=django.db.models.deletion.CASCADE,
 | 
						|
                        related_name="+",
 | 
						|
                        to=settings.AUTH_USER_MODEL,
 | 
						|
                    ),
 | 
						|
                ),
 | 
						|
                (
 | 
						|
                    "user_profile",
 | 
						|
                    models.ForeignKey(
 | 
						|
                        on_delete=django.db.models.deletion.CASCADE,
 | 
						|
                        related_name="+",
 | 
						|
                        to=settings.AUTH_USER_MODEL,
 | 
						|
                    ),
 | 
						|
                ),
 | 
						|
            ],
 | 
						|
            options={
 | 
						|
                "unique_together": {("user_profile", "muted_user")},
 | 
						|
            },
 | 
						|
        ),
 | 
						|
    ]
 |