Skip to content

Commit

Permalink
Merge pull request #143 from sinag/development
Browse files Browse the repository at this point in the history
mvoe new community link fix to master
  • Loading branch information
sinag authored Dec 16, 2019
2 parents 1c27966 + c543a44 commit 95c8cb4
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 37 deletions.
21 changes: 11 additions & 10 deletions code/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified code/community/__pycache__/models.cpython-37.pyc
Binary file not shown.
3 changes: 2 additions & 1 deletion code/community/models.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
from django.contrib.auth.models import User
from django.db import models
from root import settings
from django.contrib.auth import get_user_model

"""
Community object model
"""


class Community(models.Model):
author = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.PROTECT, default=settings.DEFAULT_ADMIN,
author = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.PROTECT, default=get_user_model().objects.get(username="admin"),
blank=False, null=False, db_index=True)
name = models.CharField(max_length=100, blank=False, null=False)
created_on = models.DateTimeField(auto_now_add=True, blank=False, null=False)
Expand Down
27 changes: 19 additions & 8 deletions code/community/templates/community/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,25 @@ <h5 class="card-title">{{ community.name }}</h5>
<div class="card-header text-white bg-secondary">
Oops, no community found!
</div>
<div class="card-body">
<h5 class="card-title">There is nothing here</h5>
<p class="card-text">Click plus icon below to create a new community</p>
<a href="#" class="btn btn-primary"><span class="fas fa-plus"></span> New Community</a>
</div>
<div class="card-footer text-muted">
Just now
</div>
{% if user.is_authenticated %}
<div class="card-body">
<h5 class="card-title">There is nothing here</h5>
<p class="card-text">Click plus icon below to create a new community</p>
<a href="{% url 'community:create' %}" class="btn btn-primary"><span
class="fas fa-plus"></span> New Community</a>
</div>
<div class="card-footer text-muted">
Just now
</div>
{% else %}
<div class="card-body">
<h5 class="card-title">There is nothing here</h5>
<p class="card-text">Please login and create a new community</p>
</div>
<div class="card-footer text-muted">
Just now
</div>
{% endif %}
</div>
</div>
{% endif %}
Expand Down
Binary file modified code/root/__pycache__/settings.cpython-37.pyc
Binary file not shown.
36 changes: 18 additions & 18 deletions code/root/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,24 +140,24 @@
STATIC_URL = '/static/'
# STATIC_ROOT = os.path.join(BASE_DIR, 'static2')

LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'file': {
'level': 'ERROR',
'class': 'logging.FileHandler',
'filename': 'django.log',
},
},
'loggers': {
'django': {
'handlers': ['file'],
'level': 'ERROR',
'propagate': True,
},
},
}
# LOGGING = {
# 'version': 1,
# 'disable_existing_loggers': False,
# 'handlers': {
# 'file': {
# 'level': 'ERROR',
# 'class': 'logging.FileHandler',
# 'filename': 'django.log',
# },
# },
# 'loggers': {
# 'django': {
# 'handlers': ['file'],
# 'level': 'ERROR',
# 'propagate': True,
# },
# },
# }

STATIC_URL = '/static/'
LOGIN_REDIRECT_URL = '/'
Expand Down

0 comments on commit 95c8cb4

Please sign in to comment.